Browse thread
ocaml 2.02 bug: curried printf
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Christian Lindig <lindig@i...> |
| Subject: | Re: another approach to sprintf (Re: ocaml 2.02 bug: curried printf) |
+-- Xavier Leroy
| It's a cute trick. One drawback is that the format is not a
| character string, but needs to be expressed using special
| functions and infix operators.
+-- John Prevost
| It does, however, mean that people can extend the set of patterns
| that can be used in printf in a more palatable way than the
| %a mechanism. Especially with neat things like Danvy's "lis"
| combinator.
The suggested functional approach to printf has another possible
drawback: when you want to express all the options like "%5.5f"
possible in C style printf formatting you need a whole bunch of
functions. Since OCaml has no overloading a single `float' function
for floats can not capture them all.
-- Christian
--
Christian Lindig Technische Universitaet Braunschweig, Germany
http://www.cs.tu-bs.de/softech/people/lindig
lindig@ips.cs.tu-bs.de