From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA04138; Mon, 8 Oct 2001 18:09:32 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA04106 for ; Mon, 8 Oct 2001 18:09:31 +0200 (MET DST) Received: from heplix4.ikp.physik.tu-darmstadt.de (heplix4.ikp.physik.tu-darmstadt.de [130.83.210.158]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f98G9Uv22307 for ; Mon, 8 Oct 2001 18:09:30 +0200 (MET DST) Received: (from ohl@localhost) by heplix4.ikp.physik.tu-darmstadt.de (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f98G9T131189; Mon, 8 Oct 2001 18:09:29 +0200 Date: Mon, 8 Oct 2001 18:09:29 +0200 Message-Id: <200110081609.f98G9T131189@heplix4.ikp.physik.tu-darmstadt.de> From: Thorsten Ohl To: caml-list@inria.fr Subject: [Caml-list] Printf: variable field width/precision Reply-to: ohl@hep.tu-darmstadt.de Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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