English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Printf: variable field width/precision
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-10-12 (17:36)
From: Alan Schmitt <alan.schmitt@i...>
Subject: Re: [Caml-list] Printf: variable field width/precision
* Xavier Leroy (xavier.leroy@inria.fr) wrote:
> > In the C library, printf(3) supports variable field widths and
> > precisions with the `*' specifier.
> > 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?
> I've never needed the '*' specifier so far, but I agree this should be
> supported at some point.  As far as I can say, this requires a bit of
> work, though.

By the way, it also seems that the + format is not supported either:

# Printf.printf "%+f" 2. ;;
Bad format `%+'


The hacker: someone who figured things out and made something cool happen.
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