In addition to all of the new features planned for ColdFusion Centaur, and the introduction of the new ColdFusion IDE, we’ve also managed to sneak in lots of smaller CFML enhancements, some of which are long overdue. Here are some of what we’ve been working on.
Assignments can now be chained, so this will work:
Ternary operators are now supported:
In ColdFusion 8 we allowed you to create structures and arrays implicitly, like this:
The problem is that we didn’t quite finish the implementation, and so if you wanted to pass that structure to a tag or function you’d have needed to first save it to a temporary variable, like this:
This has been fixed in Cenatur, and the following will now work (as it should have before):
tag has been added, to complement the existing continue CFSCRIPT operator.
Support for “finally” has been added via a
tag and a finally operator.
- One of the biggest CFML enhancement is in CFSCRIPT which now supports all of CFML (with minor exceptions where not appropriate). You can now build CFCs entirely in CFSCRIPT, including Application.cfc. You can invoke any tags and functions in CFSCRIPT. You can use new operators like abort, exit, include, and throw, to simplify your CFSCRIPT. In fact, you can now build a complete ColdFusion application entirely in CFSCRIPT, without using any CFML, if you are so inclined.
To make the CFSCRIPT enhancements work properly, we’ve also added a few new functions, WriteDump() is the equivalent of
, WriteLog()is the equivalent of (both of these are named similarly to the existing WriteOutput() function), Trace() is the equivalent of , Location() is the equivalent of , and Throw() is the equivalent of .
- ColdFusion variables (including complex types like arrays, structures, queries, CFCs, and Java objects) can be serialized to binary objects using the new SaveCFObject() function, and then deserialized later as needed using LoadCFObject(). These functions can work with variables as well as files, so objects can be serialized to disk and then read later when needed.
And we’re not done yet. Stay tuned, more cool stuff to follow!