Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christian Lindig <lindig@cs.uni-sb.de>
To: Caml List <caml-list@inria.fr>
Cc: Norman Ramsey <nr@eecs.harvard.edu>
Subject: [Caml-list] Printf: export of format_int et al.
Date: Wed, 4 Aug 2004 08:54:40 +0200	[thread overview]
Message-ID: <28166D0C-E5E3-11D8-B332-000A95CB833C@cs.uni-sb.de> (raw)


We have code that uses some of the external functions like format_int 
and format_float.

external format_int: string -> int -> string = "caml_format_int"

Now that OCaml 3.08 has prefixed all C names with "caml_" (eg. 
"caml_format_int" instead of "format_int") it is more difficult to 
write code that compiles with old and new OCaml versions. It would be 
of great help if future OCaml versions would export these C functions 
as (stable) Caml values such that we could use these rather than the 
external values directly.

For example, format_int is defined in the Printf implementation, but 
not exported in the interface. Hashtbl gets it right, because 
"caml_hash_univ_param" is exported as Hashtbl.hash_param in the 
interface. Therefore we can use hash_param rather than 
cam_hash_univ_param.

external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" 
"noalloc"

Maybe a new module "Externals" to centralize all these exports would be 
a solution if we don't want to touch the existing interfaces.

-- Christian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


                 reply	other threads:[~2004-08-04  6:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=28166D0C-E5E3-11D8-B332-000A95CB833C@cs.uni-sb.de \
    --to=lindig@cs.uni-sb.de \
    --cc=caml-list@inria.fr \
    --cc=nr@eecs.harvard.edu \
    /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