ColdFusion 10 supports colon separator in implicit struct definition

Published: {ts '2014-01-14 00:00:00'}
Author: Steven Neiland
Site Url: http://www.neiland.net/article/coldfusion-10-supports-colon-separator-in-implicit-struct-definition/

So I was working on some CF10 code the other day after having been doing javascript for a while when I accidentally used the colon character as my separator the same way you do in javascript. It was only later when I was reviewing the code before committing to source control that I realized that it didn't throw any errors and the structures were correctly formed.

I don't know how I missed it but sure enough when I googled it there it was on the ColdFusion 10 Language Enhancements List "Implicit struct now supports use of : (colon) separator".

Give it a try

These two structs will be created the exact same way.

Going forward

Now I've known that Railo has supported the colon separator since version 3 but I never used it because I switch between CF and Railo on such a regular basis that I try not to use too many engine specific enhancements. So I was pleasantly surprised that CF10 also supports it. Needless to say I may be late to the game on this but I am going to start using this syntax from now on.