Possibility of standardized sprintf() in ES4?
P T Withington
ptw at pobox.com
Mon Oct 15 09:28:08 PDT 2007
I would be very interested in this. Have a look at our
implementation (not called sprintf, but has similar goals). Our
implementation has an additional goal of keeping an association
between the result string and the objects it represents. Being a
dynamic language, I think es4 should aspire to more than just C sprintf.
Our source is licensed under CPL.
On 2007-10-15, at 08:27 EDT, Dan Scott wrote:
> I've been working on a project requiring i18n support in ES
> (http://open-ils.org), and it's become clear that a standard sprintf()
> implementation in ES would have been very useful. There are currently
> some open-source sprintf() implementations written in ES, but all of
> the ones I've looked at so far seem to either have unusual licenses or
> incomplete implementations (positional specifier support is absolutely
> necessary for i18n, for example.)
> http://hexmen.com/blog/2007/03/printf-sprintf/ is probably the closest
> thing I've found to a solution yet.
> For something as basic as string formatting, it would be great to be
> able to count on a core implementation of sprintf() (or something
> equivalent) in a future version of ES. Jon Udell made a comment to the
> effect that string formatting was a part of the TG1 wiki at
> but I've been unable to find that section in the wiki (unless that is
> limited strictly to String.replace()).
> Is there any other interest in adding a native sprintf() (probably as
> String.sprintf()) to the ES4 specs?
> Dan Scott
> Laurentian University
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
More information about the Es4-discuss