From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA22053 for caml-redistribution; Mon, 25 Aug 1997 15:54:15 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA19719 for ; Mon, 25 Aug 1997 13:56:20 +0200 (MET DST) Received: from cri.ens-lyon.fr (cri.ens-lyon.fr [140.77.1.32]) by nez-perce.inria.fr (8.8.7/8.8.5) with ESMTP id NAA28413 for ; Mon, 25 Aug 1997 13:56:17 +0200 (MET DST) Received: from lip.ens-lyon.fr (lip [140.77.11.11]) by cri.ens-lyon.fr (8.8.5/8.8.1) with ESMTP id NAA26194; Mon, 25 Aug 1997 13:55:54 +0200 (MET DST) Received: from champagne.ens-lyon.fr (champagne [140.77.11.30]) by lip.ens-lyon.fr (8.8.5/8.8.0) with ESMTP id NAA28662; Mon, 25 Aug 1997 13:55:51 +0200 (MET DST) Received: (from jcourant@localhost) by champagne.ens-lyon.fr (8.8.5/8.8.0) id NAA04138; Mon, 25 Aug 1997 13:55:49 +0200 (MET DST) Date: Mon, 25 Aug 1997 13:55:49 +0200 (MET DST) Message-Id: <199708251155.NAA04138@champagne.ens-lyon.fr> From: Judicael Courant To: ajenkins@cs.umass.edu CC: caml-list@inria.fr In-reply-to: <199708022207.SAA02234@noho-us147.javanet.com> (ajenkins@cs.umass.edu) Subject: Re: Suggested addition to Unix module Reply-to: Judicael.Courant@ens-lyon.fr (Judicael Courant) Mime-Version: 1.0 (generated by tm-edit 7.43) Content-Type: text/plain; charset=US-ASCII Sender: weis Hello, > >Also, is there a way to cast in OCaml instead of doing what I've done >here, when you know the internal representations of two types are the >same? I realize this could be abused, turning OCaml into C, but then >what I did below is kind of silly too. Thank you. > you should consider using the function magic of module Obj... it is a more generic implementation of your functions fd_of_descr and descr_of_fd. Judicael. -- Judicael.Courant@ens-lyon.fr, http://www.ens-lyon.fr/~jcourant/ tel : (+33) 04 72 72 85 82 Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth