Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* typing question
@ 2007-04-24 18:14 micha
  2007-04-24 22:22 ` [Caml-list] " Philippe Wang
  0 siblings, 1 reply; 2+ messages in thread
From: micha @ 2007-04-24 18:14 UTC (permalink / raw)
  To: caml-list

Hi,

why is the type of register1  'a -> string but the type of register2
_'a -> string?


cheers
 Michael



let symbol_id = ref 0;;
let register1 fkt =
    let name = "symbol-" ^ (string_of_int !symbol_id) in
    incr symbol_id;
    Callback.register name fkt;
    name
;;

let register2 =
    let symbol_id = ref 1 in
    fun fkt -> let name = "symbol-" ^ (string_of_int !symbol_id) in
    incr symbol_id;
    Callback.register name fkt;
    name
;;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-24 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-24 18:14 typing question micha
2007-04-24 22:22 ` [Caml-list] " Philippe Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox