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 RAA14752; Tue, 11 Jun 2002 17:45:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA14742 for ; Tue, 11 Jun 2002 17:45:29 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5BFjRH18783; Tue, 11 Jun 2002 17:45:27 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA14762; Tue, 11 Jun 2002 17:45:27 +0200 (MET DST) Date: Tue, 11 Jun 2002 17:45:27 +0200 From: Xavier Leroy To: Max Kirillov Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix.file_descr -> int ??? Message-ID: <20020611174527.A14450@pauillac.inria.fr> References: <20020611213158.A680@max.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20020611213158.A680@max.home>; from max630@mail.ru on Tue, Jun 11, 2002 at 09:31:59PM +0700 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Suddently, I'm unable to recover file descriptor from Unix's > file_descr. At least, Unix module does not contain any > function doing that and the type is abstract. > What was a reason for the limitaion? Well, because file descriptors are an abstract data type. What makes you think that they are integers? None of the integer operations make any sense on file descriptors, e.g. adding or multiplying two file descriptors. It is true that under Unix, file descriptors happen to be implemented as integers, but that's purely accidental. E.g. under Windows, Unix.file_descr is not implemented by integers. > Is there some way (apart from hacking ocaml) to do that? Within well-typed code, no. With typing hacks, yes. But what would you want to do this? - Xavier Leroy ------------------- 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