preprocessing printf/regex strings (like ocaml)
anatoli
anatoli@yahoo.com
Tue, 14 May 2002 07:30:33 -0700 (PDT)
Martin Norbäck <d95mback@dtek.chalmers.se> wrote:
> I agree that i18n needs positional arguments.
> What's wrong with simply doing like this:
>
> printf "I have %. %. %.." ["trained", show 1, "Jedi"]
> printf "%2. %3. %1. I have." ["trained", show 1, "Jedi"]
Nothing is exceptionally wrong with it, except it's not
as flexible. Since everything is show'n, how would you
handle things like "%5.2f" or "%*d"? In Brian Huffman's
version it's almost trivial to add. I know I can use
formatDouble and whatnot, but the code looks cluttered
this way. "C" printf has many pitfalls, but I like its
terseness.
--
anatoli
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com