Possibility of standardized sprintf() in ES4?
denials at gmail.com
Sat Oct 27 11:06:04 PDT 2007
On 16/10/2007, Alex Russell <alex at dojotoolkit.org> wrote:
> [ snip ]
> > Sure. From what I can see of the Microsoft documentation a
> > standardized String.format() function would meet the need for a
> > standardized way of formatting a string just as well as a method
> > based on C/Perl/PHP/Ruby sprintf() and Python's native string
> > formatting, where named parameters are used instead of positional
> > parameters.
> Python allows both, and I prefer that style.
> > Assuming there are no intellectual property concerns with adopting
> > Microsoft's specification for this method, it would satisfy my use
> > case for a string formatting method that accepts explicit positional
> > or named parameters in support of internationalized text. I would
> > simply be delighted if ES4 saved me and others from having to roll
> > our own string formatter classes!
> Eh, just go w/ Python's. It's more flexible, "feels" more like printf
> if/when you need it to, and can be used in the .NET-ish way.
Just following up on the discussion - since I've seen an announcement that
the spec for ES4 is now closed, does this mean that a proposal for an
addition of a standardized sprintf / format addition to the String object is
off the table until ES5? Or have the Ecma members of the group decided that
there is no actual requirement for this functionality?
Beyond raising this issue on the mailing list and finding some support in
principle for the proposal, if not for the actual form of the proposal, I'm
not sure what the next step is supposed to be. It does seem like a major
functionality gap in the language, to me, but I'm only one small voice.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Es4-discuss