tracker issue : CF-4010491

select a category, or use search below
(searches all categories and all time range)
Title:

Range as a type and a literal

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 06/22/2015

Components: Language

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 8

From http://blog.adamcameron.me/2015/06/what-id-like-to-see-in-coldfusion12.html

[1..10] should define a range which is a collection object representing the numbers 1-10. Perhaps implement it as [x..y;z] where z is (optionally) the increment.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4010491

External Customer Info:
External Company:  
External Customer Name: Adam
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

See Ruby example: http://ruby-doc.org/core-2.2.0/Range.html PHP: http://php.net/manual/en/function.range.php (I do not recommend this approach: have a literal, not a function) Groovy: http://www.javaworld.com/article/2072503/ranges-in-groovy-are-hip.html
Comment by External U.
7146 | June 22, 2015 03:07:18 AM GMT
This is a cool idea. It keeps code very easy to read.
Vote by External U.
7148 | June 29, 2015 08:49:57 AM GMT
Another great idea. Two thumbs up.
Vote by External U.
7149 | June 29, 2015 08:57:32 PM GMT
Awesome idea.......................................
Vote by External U.
7150 | June 29, 2015 10:05:13 PM GMT
................................................................
Vote by External U.
7151 | July 01, 2015 02:56:27 AM GMT
Certainly would speed up coding.
Vote by External U.
7152 | July 09, 2015 11:22:46 AM GMT
Ranges would be a very nice addition to CFML. Ideally implemented as generators (so they don't create actual arrays!) that would auto-convert to a real array in contexts that really needed an array.
Vote by External U.
7153 | July 09, 2015 11:25:16 AM GMT
Because Adam Cameron's always right with these things.
Vote by External U.
7154 | July 09, 2015 11:26:02 AM GMT
This would be another great simplicity syntax enhancement for the language.
Vote by External U.
7155 | July 09, 2015 12:22:12 PM GMT
How's that "Needs Review" going? You've had two years now...
Comment by Adam C.
7147 | August 02, 2017 07:14:53 AM GMT