Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* module thinning in Caml 1.06
@ 1997-12-04 20:10 Scott Alexander
  1997-12-05 22:12 ` Francois Rouaix
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Alexander @ 1997-12-04 20:10 UTC (permalink / raw)
  To: caml-list

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-12-07 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-04 20:10 module thinning in Caml 1.06 Scott Alexander
1997-12-05 22:12 ` Francois Rouaix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox