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):

You get the idea. Oh, and before you ask, the updater is coming … soon!

14 thoughts

  1. Good stuff!
    Any plans for <cftag mystruct="#{firstname=’Ben’,lastname=’Forta’}#"> ?
    Even if not, this is still a really exciting development.

  2. Finally. Don’t want to sound like a jerk, but this should have been fixed before cf8’s release. Without nesting implicit creation was useless.
    Now can they fix the Isvalid() integer bug and add an integer type to the cfargument tag. Little things like those make life hard.

  3. I have to agree with Tony. That was one of the most expected features. I don’t know how lack of nesting might pass QA. Many people complains MS releases beta versions but lack of nesting makes me think Adobe released somewhat beta version of CF. I am sure there is many more features like that.
    Anyway – good to see that coming!

  4. Thats great news! I always thought the implicit structure and array creation was only "half" done in CF8 without the ability to nest. I do hope it allows for N levels of nesting 🙂

  5. This is great news, I just hope plans don’t change. I currently work around this with two functions of my own called Struct and array.
    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 = ‘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.

Leave a Reply