Additional language features
P T Withington
ptw at pobox.com
Sat Mar 5 12:00:13 PST 2011
On 2011-03-05, at 14:38, Christian Mayer wrote:
> Am 05.03.2011 17:31, schrieb Brendan Eich:
>> On Mar 5, 2011, at 5:41 AM, Christian Mayer wrote:
>>
>>> 1) A printf compatible format string
>>
>> http://wiki.ecmascript.org/doku.php?id=strawman:string_format
>> http://wiki.ecmascript.org/doku.php?id=strawman:quasis
>
> Both handle nicely the placement of "external" values into a string at
> given positions.
>
> But this is only one part of an printf-format string. What I'm still
> missing is the feature to define the format of the inserted data. This
> is for me more important, as that can't be easily achieved by the
> current ECMAScript.
FWIW, OpenLaszlo has a fairly complete implementation of 'printf':
http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
created long before the quasis proposal (which is quite nice). I agree there needs to be a way to direct _how_ the value is interpolated, and I suspect this is what the comment "Meta data can be attached using a syntactic convention chosen by the quasi function" is meant to hint at. An example along the lines of printf format control might be nice...
More information about the es-discuss
mailing list