Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "T. Kurt Bond" <thomas.k.bond@cpmx.saic.com>
To: caml-list@pauillac.inria.fr
Cc: tkb@wvlink.mpl.com
Subject: string variables in Printf.* calls: Bug, or lack of understanding?
Date: Thu, 13 Feb 1997 13:31:02 -0500	[thread overview]
Message-ID: <199702131831.NAA22295@abetti> (raw)

Hello,

[I apologize for the lack of a French version of this message.]

I recently observed the following while runing Objective Caml under
Windows NT and UnixWare 1.1:

	    Objective Caml version 1.03

[1] # let s = "%f" in Printf.printf s 10.5;;
    Characters 30-31:
    This expression has type string but is here used with type
      ('a, out_channel, unit) format

[2] # Printf.printf "%f" 10.5;;
    10.500000- : unit = ()

I don't understand why the variable s, which is bound to a string value,
causes the error in statement 1, while using a literal string in
statement 2 works as expected.  Can anyone explain?  Or is this a bug?

-- 
T. Kurt Bond, Thomas.K.Bond@cpmx.saic.com






             reply	other threads:[~1997-02-18 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-13 18:31 T. Kurt Bond [this message]
1997-02-18 16:39 ` Xavier Leroy
1997-02-24 20:40 Valentin Bonnard

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=199702131831.NAA22295@abetti \
    --to=thomas.k.bond@cpmx.saic.com \
    --cc=caml-list@pauillac.inria.fr \
    --cc=tkb@wvlink.mpl.com \
    /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