Browse thread
Run-time evaluation of a Printf format string
-
Jan Kybic
- David Teller
- Edgar Friendly
- Dave Benjamin
- Stéphane Glondu
[
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: | Stéphane Glondu <steph@g...> |
| Subject: | Re: [Caml-list] Run-time evaluation of a Printf format string |
Jan Kybic wrote: > I would need an equivalent of Printf.sprintf where the > format string is not constant, it is read from the command line. > The motivation is to let the user specify a template for file names, > such as "img%03d.png". Can this be achieved in Ocaml? It seems not, as > Pervasives.string_of_format only accepts constant strings. > Or is there some external library useful for this task? What about Scanf.format_from_string? Cheers, -- Stéphane