To the delight of many a ColdFusion developer, in CF8 we added support for implicit array and structure creation. And now we're taking this one step further in the ColdFusion 8 updater (due out shortly) to allow for arrays and structures to be nested. As an example, the following should work (and I did say "should", this is planned, and plans change):
<cfset cfevangelists=[{firstname="Ben", lastname="Forta"}, {firstname="Adam", lastname="Lehman"}]>
You get the idea. Oh, and before you ask, the updater is coming ... soon!
cfevangelists = [{firstname="Ben", lastname="Forta"}, {firstname="Adam", lastname="Lehman"}]
--- Ben
Any plans for <cftag mystruct="#{firstname='Ben',lastname='Forta'}#"> ?
Even if not, this is still a really exciting development.
Thanks!
Now can they fix the Isvalid() integer bug and add an integer type to the cfargument tag. Little things like those make life hard.
Anyway - good to see that coming!
a_component.StoreInformation( key = arguments.key, data = { firstname= a_str_firstname } )
(posted here http://cfstuff.blogspot.com/2008/01/very-uncool-no...)
cfevangelists = [{firstname="Ben", lastname="Forta"}, {firstname="Cafe", lastname="Lehmann"}]
http://www.cafe-lehmann.de - they make good cake!
Array(1, 2, array('a', 'b', 'c'), 3);
Struct(this = 'that', foo = Struct(bars = Array(1, 4, 7)));
They do the trick for now but I'd love to use the new methods, probably be quicker too.
I second Hansjoerg with passing them directly to a named argument in a component / function.
Speaking of which, any ideas if the updater is planned to fix named arguments for scoped functions? For example, foo(bar = 'test') works but variables.foo(bar = 'test') throws an error, same goes for whatever scope I copy the function too. I did submit it via some old bug page link but never heard anything back.