English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Mutability analysis too strict?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-12-10 (06:17)
From: Ohad Rodeh <ORODEH@i...>
Subject: [Caml-list] Mutability analysis too strict?
   I have a problem with the mutability analysis for hash-tables.
For example:
     let h = Hashtbl.create 10 ;;
     h : ('_a, '_b) Hashtbl.t
instead of:
     h ('a, 'b) Hashtbl.t

My specific hashtable contains immutable objects that can be added
and removed to the table.  The default analysis is too strict, forcing me
to use Obj.magic for coercion ('_b -> 'b). This is safe in this case,
because I know
the objects are immutable. However, in the general case, I don't see
why it is neccessary.

 Anyone cares to explain?


Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr