Status/Resolution/Reason: To Fix//
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 01/24/2015
Components: Language
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 1
It'd be excellent if structs, arrays and other complex types had a toString() method which was called automatically if an object of this type is used as a string. The default behaviour could be to serialise to JSON, perhaps, eg:
person = {firstName="Zachary", lastName="Cameron Lynch"};
writeOutput("My son is #person#"); // My son is {"lastName":"Cameron Lynch","firstName":"Zachary"}
Better yet would be to be able to specify a CFC, Struct.cfc (in the root of the app? In a lib dir? As a setting in Application.cfc?) which implements an interface which provides for methods like toString(), toNumeric(), etc, which are then used when using a struct as [one of those types].
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3927012
External Customer Info:
External Company:
External Customer Name: Adam
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: