Forum Navigation
Suggested additions to Layout formatting
Posted: 06/09/07 17:26:05So formatting in Layout (and in everything formatted in Tango) takes a format string as the first param, and then all the things to be formatted as the varargs, much like printf.
Things that I severely miss from Phobos' formatting are (1) the ability to format something without a format string and (2) making any string in the parameter list behave like a formatting string.
I've simulated these changes in MiniD's formatting. A more in-depth explanation is available here.
What do you think? Sean mentioned that it might be a security risk (when printing out a string that shouldn't be used as a formatting string), but Tango (1) catches and formats invalid indices as "{invalid index}", (2) determines how to output a parameter based on the type of the parameter and not on the formatting specifier, and (3) will catch malformed formatting specifiers anyway. I don't know what security risks this poses.
I don't know why I'd make a new scripting language. I mean, I might as well just draw some lines in the sand with a stick.