From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA01495; Fri, 31 May 2002 23:06:48 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA01706 for caml-list@pauillac.inria.fr; Fri, 31 May 2002 23:06:47 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA30926 for ; Fri, 31 May 2002 20:06:22 +0200 (MET DST) Received: from mallaury.noc.nerim.net (mallaury.noc.nerim.net [62.4.17.82]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4VI6L526694 for ; Fri, 31 May 2002 20:06:21 +0200 (MET DST) Received: from karryall.dnsalias.org (karryall.dnsalias.org [62.4.18.180]) by mallaury.noc.nerim.net (Postfix) with ESMTP id 006D562D04; Fri, 31 May 2002 20:06:19 +0200 (CEST) Received: by karryall.dnsalias.org (Postfix, from userid 500) id 266E24D034C; Fri, 31 May 2002 20:06:20 +0200 (CEST) From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15607.48028.50986.375950@karryall.dnsalias.org> Date: Fri, 31 May 2002 20:06:20 +0200 To: Christophe TROESTLER Cc: caml-list@inria.fr Subject: Re: [Caml-list] about Obj.magic In-Reply-To: <20020531.181936.55316303.debian00@tiscalinet.be> References: <003601c20884$0d78efd0$7900a8c0@warp> <20020531225840C.garrigue@kurims.kyoto-u.ac.jp> <20020531.181936.55316303.debian00@tiscalinet.be> X-Mailer: VM 7.05 under Emacs 21.2.1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Christophe TROESTLER [Friday 31 May 2002] : > On Fri, 31 May 2002, Jacques Garrigue wrote: > > > > From: "Warp" > > > > > > 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