Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Scott Alexander <salex@dsl.cis.upenn.edu>
To: caml-list@inria.fr
Subject: module thinning in Caml 1.06
Date: Thu, 04 Dec 1997 15:10:18 EST	[thread overview]
Message-ID: <199712042010.PAA24468@codex.cis.upenn.edu> (raw)

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





             reply	other threads:[~1997-12-07 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-04 20:10 Scott Alexander [this message]
1997-12-05 22:12 ` Francois Rouaix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199712042010.PAA24468@codex.cis.upenn.edu \
    --to=salex@dsl.cis.upenn.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox