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
Suggested addition to Unix module
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-08-25 (13:54)
From: Judicael Courant <Judicael.Courant@e...>
Subject: Re: Suggested addition to Unix module


>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

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