caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Printf: variable field width/precision
@ 2001-10-08 16:09 Thorsten Ohl
  2001-10-12 14:23 ` Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Ohl @ 2001-10-08 16:09 UTC (permalink / raw)
  To: caml-list

In the C library, printf(3) supports variable field widths and
precisions with the `*' specifier.

   The field width

       An optional decimal digit string (with nonzero first digit)
       specifying a minimum field width.  [...]  Instead of a decimal
       digit string one may write `*' or `*m$' (for some decimal
       integer m) to specify that the field width is given in the next
       argument, or in the m-th argument, respectively, which must be
       of type int. [...]

Unfortunately, neither the O'Caml library nor the compiler accept `*'.
If the `*' form is available, the `*m$' form is hardly needed, but I
couldn't find a way to hack around the missing `*' (handling every
conceivable width/precision pair as a special case doesn't count ...).

Is there are chance that variable field widths for the benefit of
numerical programs will be supported in the future?  [It would be easy
to hack the library, but since the compiler must perform its own magic
for type safety, I couldn't distribute the code without asking users
to patch the compiler.]

Or does anybody know a nice workaround?

Merci,
-Thorsten
-- 
Thorsten Ohl, Physics Department, TU Darmstadt -- ohl@hep.tu-darmstadt.de
http://heplix.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-12 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-08 16:09 [Caml-list] Printf: variable field width/precision Thorsten Ohl
2001-10-12 14:23 ` Xavier Leroy
2001-10-12 17:31   ` Alan Schmitt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).