Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: William Chesters <williamc@dai.ed.ac.uk>
To: caml-list@inria.fr
Subject: Re: ocaml 2.02 bug: curried printf
Date: Fri, 12 Mar 1999 15:31:55 GMT	[thread overview]
Message-ID: <199903121531.PAA03531@toy.william.bogus> (raw)
In-Reply-To: <19990312160017.60444@pauillac.inria.fr>

Xavier Leroy writes:
 > The behavior of the *printf functions when partially applied
 > has always been a bit strange even before 2.02: [...]

Ooooh yes, I never noticed that ...

 > The alternative is to keep a buffer-based sprintf that is efficient
 > and consistent with printf ("consistent" in the sense of "as weird as"),
 > but is not really usable in partial application contexts.
 > 
 > Any opinions?

The change in behaviour was a nuisance to me (and I now have a module
called Printf201!).  In spite of that I'd be happy to stick with the
new semantics if it's more efficient.  I say that becase I believe the
reason I used constructs like

       concat " " (Array.map (sprintf "...") xs)

, for generating C code and string representations of complex objects,
was precisely because of the lack of extensible string buffers.  With
Buffer available I would be more likely to use a `for' loop with
`bprintf' (or indeed `Format.bprintf').




  reply	other threads:[~1999-03-12 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-06  1:38 William Chesters
1999-03-12 15:00 ` Xavier Leroy
1999-03-12 15:31   ` William Chesters [this message]
1999-03-19  8:47   ` another approach to sprintf (Re: ocaml 2.02 bug: curried printf) Eijiro Sumii
1999-03-23 16:17     ` Xavier Leroy
1999-03-24 19:37       ` John Prevost
1999-03-25 13:29         ` Christian Lindig
1999-03-25 20:52           ` John Prevost
1999-03-29 16:31         ` Xavier Leroy
1999-03-24 23:48       ` Frank A. Christoph

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=199903121531.PAA03531@toy.william.bogus \
    --to=williamc@dai.ed.ac.uk \
    --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