From: Thorsten Ohl <ohl@hep.tu-darmstadt.de>
To: caml-list@inria.fr
Subject: [Caml-list] Printf: variable field width/precision
Date: Mon, 8 Oct 2001 18:09:29 +0200 [thread overview]
Message-ID: <200110081609.f98G9T131189@heplix4.ikp.physik.tu-darmstadt.de> (raw)
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
next reply other threads:[~2001-10-08 16:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-08 16:09 Thorsten Ohl [this message]
2001-10-12 14:23 ` Xavier Leroy
2001-10-12 17:31 ` Alan Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200110081609.f98G9T131189@heplix4.ikp.physik.tu-darmstadt.de \
--to=ohl@hep.tu-darmstadt.de \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox