English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
Question about float refs.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David House <dmhouse@g...>
Subject: Re: [Caml-list] Question about float refs.
Note that you can directly observe boxedness using the Obj functions:

# type t1 = { a : float; b : int };;
type t1 = { a : float; b : int; }
# type t2 = { c : float; d : float };;
type t2 = { c : float; d : float; }
# let x1 = { a = 1.; b = 2 };;
val x1 : t1 = {a = 1.; b = 2}
# let x2 = { c = 3.; d = 4. };;
val x2 : t2 = {c = 3.; d = 4.}
# Obj.tag (Obj.repr x1);;
- : int = 0
# Obj.tag (Obj.repr x2);;
- : int = 254

For the use case you describe, I believe your best bet is to define a
float_ref type as you describe.