English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
[Caml-list] about Obj.magic
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Andrieu <oandrieu@n...>
Subject: Re: [Caml-list] about Obj.magic
 Christophe TROESTLER [Friday 31 May 2002] :
 > On Fri, 31 May 2002, Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> wrote:
 > > 
 > > From: "Warp" <warplayer@free.fr>
 > > 
 > > > > So, we should be very careful to use 'Obj.magic'. Can somebody tell me
 > > > > the appropriate situation to use this function?
 > > > 
 > > > One case can be 'almost-legal' : downcasting an object [...]
 > >
 > > By the way, here is a simple way to do downcasts, when really
 > > needed.  [...] No need to do anything unsafe.
 > 
 > Is there any safe way to check whether a "kind : ('a, 'b)
 > Bigarray.kind" parameter is "float64", "complex64",... or are we bound
 > to do
 > 
 >   kind  = (Obj.magic float64 : ('a, 'b) Bigarray.kind)

I'm not sure if that's what you mean but in the CVS version, there are
new functions like Genarray.kind :

  external kind: ('a, 'b, 'c) t -> ('a, 'b) kind = "bigarray_kind"

  Olivier
-------------------
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