Re: preprocessing printf/regex strings (like ocaml)

2002-05-16 Thread Robert Ennals
Robert Ennals [EMAIL PROTECTED] wrote: Surely that problem only arises if one insists on encoding all the relevant information inside a string. This is pretty much the only option, because translators and programmers are different people. Translators can deal with simple text files

Re: preprocessing printf/regex strings (like ocaml)

2002-05-16 Thread Martin Norbäck
tor 2002-05-16 klockan 10.50 skrev Robert Ennals: I don't really see what makes a string such as I have %. %. %.. [where the user has to work out what the substrings are] any harder to deal with than I have ++ action ++ ++ number ++ ++ whatas other from the fact that the

Re: preprocessing printf/regex strings (like ocaml)

2002-05-15 Thread Martin Norbäck
tis 2002-05-14 klockan 18.56 skrev anatoli: Robert Ennals [EMAIL PROTECTED] wrote: Surely that problem only arises if one insists on encoding all the relevant information inside a string. This is pretty much the only option, because translators and programmers are different people.

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Martin Norbäck
tis 2002-05-14 klockan 06.37 skrev anatoli: Brian Huffman [EMAIL PROTECTED] wrote: Here is a printf-style function that I hacked up this morning; it uses type classes but it doesn't need functional dependencies: [snip] It's very nice and even extendable, though `class Printf String' is

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Sebastien Carlier
On Tuesday, May 14, 2002, at 06:37 AM, anatoli wrote: Brian Huffman [EMAIL PROTECTED] wrote: Here is a printf-style function that I hacked up this morning; it uses type classes but it doesn't need functional dependencies: [snip] It's very nice and even extendable, though `class Printf

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread anatoli
Martin Norbäck [EMAIL PROTECTED] 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

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Robert Ennals
Martin Norbäck [EMAIL PROTECTED] 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

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Martin Norbäck
tis 2002-05-14 klockan 16.45 skrev Robert Ennals: Martin Norbäck [EMAIL PROTECTED] 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]

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Dylan Thurston
On Tue, May 14, 2002 at 03:45:36PM +0100, Robert Ennals wrote: Just thought I would jump in and say that, unlike (it seems) everyone else, I hate printf in C. It is a horrible horrible inextensible hack of a function that I find extremely awkward to use. ... I personally much prefer the

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread anatoli
Robert Ennals [EMAIL PROTECTED] wrote: I personally much prefer the syntax currently used in Haskell, which is also essentially what is used in most other recent languages, including Java, C++, and (god help me) Perl. In the example given, I could write: I have ++ action ++ ++

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread Robert Ennals
Robert Ennals [EMAIL PROTECTED] wrote: I personally much prefer the syntax currently used in Haskell, which is also essentially what is used in most other recent languages, including Java, C++, and (god help me) Perl. In the example given, I could write: I have ++ action ++

Re: preprocessing printf/regex strings (like ocaml)

2002-05-14 Thread anatoli
Robert Ennals [EMAIL PROTECTED] wrote: Surely that problem only arises if one insists on encoding all the relevant information inside a string. This is pretty much the only option, because translators and programmers are different people. Translators can deal with simple text files with one

Re: preprocessing printf/regex strings (like ocaml)

2002-05-13 Thread Brian Huffman
On Sunday 12 May 2002 03:50 am, Sebastien Carlier wrote: the python string notation (str % tuple) would fit really well too... putStrLn hello %s, you got %d right % (oliver, 5) Might be nice. What would be the type of putStrLn then? The type of putStrLn would remain unchanged.

Re: preprocessing printf/regex strings (like ocaml)

2002-05-13 Thread anatoli
Brian Huffman [EMAIL PROTECTED] wrote: Here is a printf-style function that I hacked up this morning; it uses type classes but it doesn't need functional dependencies: [snip] It's very nice and even extendable, though `class Printf String' is unfortunately not Haskell 98. But the bigger

Re: preprocessing printf/regex strings (like ocaml)

2002-05-12 Thread Sebastien Carlier
the python string notation (str % tuple) would fit really well too... putStrLn "hello %s, you got %d right" % ("oliver", 5) Might be nice. What would be the type of putStrLn then? The type of putStrLn would remain unchanged. The idea would be to let the compiler translate the string "hello

Re: preprocessing printf/regex strings (like ocaml)

2002-05-12 Thread Ralf Hinze
I'm interested to know why a string translating preprocessor doesn't exist for haskell. It seems to me that it would alleviate printf and regex like problems in an convenient, elegant and type-safe manner. An example of this I came across recently was the ocaml printf statement: #

Re: preprocessing printf/regex strings (like ocaml)

2002-05-11 Thread David Feuer
On Sun, May 12, 2002, Oliver George wrote: perl like things... msg' = replace s/love/lust/ msg or, nice regex stuff... main = case match ^(\d+) of Nothing - 0 Just (i) - i Ick! regexes can be handled much better than that. Imagine something

preprocessing printf/regex strings (like ocaml)

2002-05-11 Thread Oliver George
Hi Haskellers, I'm interested to know why a string translating preprocessor doesn't exist for haskell. It seems to me that it would alleviate printf and regex like problems in an convenient, elegant and type-safe manner. An example of this I came across recently was the ocaml printf