Possibility of standardized sprintf() in ES4?

Brendan Eich brendan at mozilla.org
Sun Oct 28 19:30:38 PDT 2007

On Oct 28, 2007, at 4:39 PM, Dan Scott wrote:

> Ah, fabulous - it seems that although the term "sprintf" appears in  
> the wiki, it's highlighted and therefore doesn't turn up in a  
> search for the term. And I was too dumb to search for "string  
> format" -- thanks for letting me know that the issue had been  
> raised in the past and that there had been some discussion about it.

I'm not sure the wiki search indexing is working correctly atm. We'll  
look into it.

> In my view, it's simply a gap in the standard library (and I  
> apologize if this was not the correct forum to raise concerns about  
> the standard library vs. the core language spec).

No worries, for better or worse, ECMA-262 specifies both core  
language and standard library.

> As I noted at the outset, there are a wide variety of sprintf()  
> (and probably String.format()) implementations already out in the  
> wild under various licenses and with varying sophistication. I  
> believe that adding such a method to the standard library would  
> help simplify the current situation and increase the ease of  
> reusing code between projects.

But which one? Whose ox gets gored? What about l10n? Etc.

You can tell we didn't have the bandwidth to take this on, and with  
so many JS libs purveying variations on a theme, we chose the virtue  
of not committing the standard to one particular string formatting  
library. But no matter the timing, having a concrete proposal would  
help. Can you link to the Microsoft String.format API doc?

More information about the Es4-discuss mailing list