Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 04/21/2018
Components: Language, Expressions
Versions: 2018
Failure Type: Others
Found In Build/Fixed In Build: / 2018,0,0,308771
Priority/Frequency: Normal /
Locale/System: / Platforms All
Vote Count: 0
This ER is for array[first:end] to be array[first:last]
Repro:
<cfscript>
myArray = [1,2,3,4]
writeDump(myArray[2:3])//returns [2] (expected [2,3])
writeDump(myArray[2:2])//returns [] (expected [2])
</cfscript>
Notes:
- In CF, "index" always means "the index that you want to reference", not ever "the index before the index that you want to reference".
- It seems there's a 50/50 split wrt which languages have the current behavior (i.e. 'end') vs proposed behavior (i.e. 'last').
- However, 100% of the languages w/ 1-based array indexing use the proposed behavior (i.e. 'last').
Related URL: https://helpx.adobe.com/coldfusion/developing-applications/the-cfml-programming-language/using-arrays-and-structures/basic-array-techniques.html
Related URL: https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28array%29#Array_system_cross-reference_list
Related URl: https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(array)#Slicing
Related thread: https://forums.adobeprerelease.com/coldfusionpr/discussion/349/array-slicing
Attachments:
Comments: