Implicit Nested Array and Structure Creation

Ben Forta posted a 'planned' feature to be added in the upcoming CF8 updater that should complete the circle in the ability to implicitly create arrays and structures by allowing us to nest the creation (like you can in several other languages out there).

Currently we can only create arrays and structures implicitly in the following manner.

<cfset mystruct = {firstname='Britney',lastName='Spears'}>
<cfset myarray =['one','two','three]>

The planned method would more closely resemble how you define nested literal arrays in Javascript or AS3.

<cfset myarray=[['one','two'],['three','four']]>
<cfset downAndOutClub =[{firstname="Britney", lastName="Spears"},{firstName="Jennifer", lastName="Lopez"},{firstName="Lindsay",lastName="Lohan"}]>

Personally I hope this makes it into the updater!

Happy Coding...

Comments
Calvin's Gravatar cfscript should be replaced by ActionScript3...
# Posted By Calvin | 3/2/08 5:52 PM