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 QAA03433 for caml-redistribution; Sun, 7 Dec 1997 16:45:20 +0100 (MET) 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 VAA13594 for ; Thu, 4 Dec 1997 21:10:33 +0100 (MET) Received: from linc.cis.upenn.edu (LINC.CIS.UPENN.EDU [158.130.12.3]) by nez-perce.inria.fr (8.8.7/8.8.5) with ESMTP id VAA13782 for ; Thu, 4 Dec 1997 21:10:29 +0100 (MET) Received: from codex.cis.upenn.edu (CODEX.CIS.UPENN.EDU [158.130.6.15]) by linc.cis.upenn.edu (8.8.5/8.8.5) with ESMTP id PAA13077 for ; Thu, 4 Dec 1997 15:10:19 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by codex.cis.upenn.edu (8.8.5/8.8.5) with SMTP id PAA24468 for ; Thu, 4 Dec 1997 15:10:18 -0500 (EST) Message-Id: <199712042010.PAA24468@codex.cis.upenn.edu> To: caml-list@inria.fr Subject: module thinning in Caml 1.06 Date: Thu, 04 Dec 1997 15:10:18 EST From: Scott Alexander Sender: weis For my active networks work, I'm using Dynlink to dynamically load modules. In the same way as MMM, I'm using module thinning to ensure that loaded modules cannot do "bad" things. Thus, I have a Safeunix.mli which is a very heavily thinned version of Unix.mli. (It is, of course, derived from the MMM module of the same name.) In Caml 1.05, I was able to say: type sockaddr = Unix.sockaddr = ADDR_UNIX of string | ADDR_INET of inet_addr * int | ADDR_PKT of int * string * int which gave me a type Safeunix.sockaddr. With this, I was able to define a function which returned the return value from Unix.sendto (a Unix.sockaddr) and call it a Safeunix.sockaddr. Under 1.05, if I then compiled a module which opens Safeunix, Safeunix would be in its list of required interfaces (as reported by objinfo), but Unix would not. Under 1.06, Unix is now a required interface, so I am unable to link. Is there a way around this short of writing a function to convert the types that I can get my code working again with 1.06. (It seems unnecessarily inefficient to run the conversion function for each call.) Thanks, Scott Alexander salex@dsl.cis.upenn.edu