caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Printf: export of format_int et al.
@ 2004-08-04  6:54 Christian Lindig
  0 siblings, 0 replies; only message in thread
From: Christian Lindig @ 2004-08-04  6:54 UTC (permalink / raw)
  To: Caml List; +Cc: Norman Ramsey


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-04  6:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04  6:54 [Caml-list] Printf: export of format_int et al Christian Lindig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).