From: Dan Bensen <danbensen@att.net>
To: Hongbo Zhang <bobzhang1988@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: submodules for Dynlink plugins?
Date: Mon, 4 Jun 2012 09:11:03 -0700 (PDT) [thread overview]
Message-ID: <1338826263.63410.YahooMailRC@web180009.mail.gq1.yahoo.com> (raw)
In-Reply-To: <4FCCD429.40509@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]
> create a foo.mllib
I tried that. Are you sure it works with
camlp4/Dynlink? Foo needs to have access
to Bar when the callback functions are called.
They're not just separate plugins that are
packaged together, they form a single plugin.
Foo defines a module that gets passed to a
functor in Bar, and the module definition and
the call to the functor are both wrapped in
a functor that gets passed to Register.Plugin.
(Foo = MetlString and Bar = Metl from the
"interface mismatch" thread.)
The problem seems to be that Dynlink can only
handle one module at a time.
________________________________
From: Hongbo Zhang <bobzhang1988@gmail.com>
To: Dan Bensen <danbensen@att.net>
Cc: caml-list@inria.fr
Sent: Mon, June 4, 2012 5:29:12 PM
Subject: [Caml-list] Re: submodules for Dynlink plugins?
On 6/4/12 11:13 AM, Dan Bensen wrote:
> How do you include module Bar inside module Foo
> so you can load Foo as a Dynlink plugin (for camlp4)?
> I tried adding a line in Foo.ml that says
>
> > module Bar = struct include Bar end
>
> but camlp4 still didn't like it:
>
> > Camlp4: Uncaught exception: DynLoader.Error
> > ("Foo.cmo", "error while linking Foo.cmo.
> > Reference to undefined global `Bar'")
create a foo.mllib
cat foo.mllib
bar
foo
then link foo.cma
dobule check
ocamlobjinfo foo.cma | grep Unit
the output should contain only Foo, Bar
tip: be careful for camlp4, don't link modules which has side effect twice.
>
> And of course just adding Bar to Foo.cma
> didn't work either.
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
[-- Attachment #2: Type: text/html, Size: 2916 bytes --]
prev parent reply other threads:[~2012-06-04 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 15:13 [Caml-list] " Dan Bensen
2012-06-04 15:28 ` [Caml-list] " Hongbo Zhang
2012-06-04 16:11 ` Dan Bensen [this message]
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=1338826263.63410.YahooMailRC@web180009.mail.gq1.yahoo.com \
--to=danbensen@att.net \
--cc=bobzhang1988@gmail.com \
--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