I'd be strongly in favor of a StringFormat class - this could be library-ized easily, letting someone opt in to even having it in their project, or call it.
Since we're changing the API (though I assume keeping the 'format string' language), you could take other steps to ensure small complied size and best runtime performance. Consider SafeHtmlTemplates or Messages, with their abilities to interpolate strings, but knowing the format string to use at compile-time, not runtime. This probably won't work in all cases (or be especially nice to use in the other cases), but will be faster and smaller when compiled to JS. On Tue Feb 10 2015 at 8:07:22 AM Benjamin DeLillo <[email protected]> wrote: > If trying to provide a fairly complete duplicate of the JRE functionality > is too much of a point of contention, would it be more acceptable to > provide a simpler/lighter-weight string interpolation implementation behind > e.g. GWT.format() or to follow the NumberFormat convention a StringFormat > class? > > > On Friday, February 6, 2015 at 11:31:32 PM UTC-5, Benjamin DeLillo wrote: >> >> For an implementation to be accepted would it have to conform to the entire >> Java Formater spec? >> http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html >> >> Would an implementation lacking the Date/Time conversions be acceptable? >> >> Would an implementation that wraps sprintf.js be acceptable (if the >> licensing is compatible)? https://github.com/alexei/sprintf.js >> >> >> What about a minimal positional substitution implementation and nothing more? >> >> -- > You received this message because you are subscribed to the Google Groups > "GWT Contributors" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-web-toolkit-contributors/9d1583ef-ae7b-41e2-9eca-207e8ef33062%40googlegroups.com > <https://groups.google.com/d/msgid/google-web-toolkit-contributors/9d1583ef-ae7b-41e2-9eca-207e8ef33062%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CADcXZMw1W_q866X0R2h8eJGWzU2Wx%2B_u62i_MAVuthEGEbnWNA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
