YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Idea: range data type
Kelvin
#1 Posted : Tuesday, September 11, 2018 7:16:39 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/26/2015(UTC)
Posts: 49
Man
Location: Georgia

Thanks: 3 times
Was thanked: 0 time(s) in 0 post(s)
I was thinking, what if there was a data type that was a pair of numbers that would return true if compared to anything equal to or between those numbers. Something like this:

Code:
if(x == $4,16$)...


I'm sure there's a better delimiter thT could be used. The reason I think this would be useful, despite being able to do
Code:
(x >= 4 && x <= 16)
, aside from serving as a shorthand for that, is being able to use it in switch statements where you'd want the same thing to happen for a certain range of numbers.

What do you guys think of a feature like this?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.082 seconds.