From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 72D417ED2A for ; Mon, 4 Jun 2012 18:11:06 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhgCAH/dzE9iiyydhmdsb2JhbABEgkWhEpB4AQEBCgkLBxYnghgBAQQBQAEBAQEqCwEBAwsLBAoDBAEBAQ0hISQKCAYTEoV/gWsBAwYFC6NGhC4BBQGEMwJIAwIIiUcBBooxYIYQiEOEP4gjgQiEQS2Efod7gT8 X-IronPort-AV: E=Sophos;i="4.75,713,1330902000"; d="scan'208,217";a="161300522" Received: from nm30.access.bullet.mail.sp2.yahoo.com ([98.139.44.157]) by mail1-smtp-roc.national.inria.fr with SMTP; 04 Jun 2012 18:11:05 +0200 Received: from [98.139.44.107] by nm30.access.bullet.mail.sp2.yahoo.com with NNFMP; 04 Jun 2012 16:11:04 -0000 Received: from [98.139.44.82] by tm12.access.bullet.mail.sp2.yahoo.com with NNFMP; 04 Jun 2012 16:11:04 -0000 Received: from [127.0.0.1] by omp1019.access.mail.sp2.yahoo.com with NNFMP; 04 Jun 2012 16:11:04 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 657763.27645.bm@omp1019.access.mail.sp2.yahoo.com Received: (qmail 94479 invoked by uid 60001); 4 Jun 2012 16:11:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1338826264; bh=/kacCVevhqIzo+9+1qMr6AaNIjYSR0az2dOQyqeS1UA=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Rvs2ldulq+z/bzexjnIfLncQQQxrBtJT/xfUSBA7izBCZrApfI8SXoDrGKV+SV8/6FuNJA7FzEsU4RuQQYgvKKX9bPHDjuNcrZf4sx9z/IsRcw/B4eY3Fp27EFHH5vYMOMfKMz9cfLFdQzijIka/yenMlDbRRx/Z6PZ+rDpWG60= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=att.net; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=yzqgsRR8gEqR+/JvLf5lKm0jnLW+Jl4CMgFc08bv/Zl4WYQgS6YU4l3qfqgsrgMhdDWKWnpyjp62GE/axNje9zK4Ca6gjqX49GEiJzjgt5EFz59kH1yw2H42citwcAUSRTht1l++UkUWdhXqW87cFoxJWxZ34qjJqGi/FcRCrsk=; X-YMail-OSG: _OwaztgVM1kY5PKA4Pxe1RdfltrH4hjXmjI3JZegDMh_dLi lEaLB5.J4gSDOK_j0V9jSwgPUaFWK5flk7fDtqj9lsDoosRqV5OBvq.fFg7C Q5gf7PavcjtGBRv_GcdDi4WrvBRTYMLsAQtbwR2gl5AALXbhaxy25Q5S22Iv ne8wjjmaWHGONsVENVrXf4qXaZNLvdDVVeiEH3aGrRFbwdto91HQL9HeRhnW vTfMOanh10V_x0q_0NaziM9wG1mnU4IEagpCUiQwU8HfHMnwFkfdmOx4bKAf dR6cvw4tSmxYagOrHO1JZCU81KhmqGV24bY2xsrlXaQMVLPg7yTEqDBl8bP3 5r9cklN9ZKaKSTTq9rZ.SbiCDkZyexG93NeARnxyNYjNmS8VBjuCVDy3GnRt e96fPbmI5rgLzu7FlgnVCYog3nupkdy4C__AimXKZl34M7g9qpFGGOlbPi4X CmyV1jsp8pMSUjxh_WjqElAI8KxGbiS1gVgmuw.xYtl.jN_ffE1iVFaRaqlU vCO9RglKfmUs4PMdWRPsNEg1yzYCWRG1AVQreN.xauhF9Dx1vLhmt3.QLzBI s8TWZBluphh1d82IUzJou Received: from [70.225.167.134] by web180009.mail.gq1.yahoo.com via HTTP; Mon, 04 Jun 2012 09:11:03 PDT X-Mailer: YahooMailRC/708 YahooMailWebService/0.8.118.349524 References: <1338822810.39402.YahooMailRC@web180012.mail.gq1.yahoo.com> <4FCCD429.40509@gmail.com> Message-ID: <1338826263.63410.YahooMailRC@web180009.mail.gq1.yahoo.com> Date: Mon, 4 Jun 2012 09:11:03 -0700 (PDT) From: Dan Bensen To: Hongbo Zhang Cc: caml-list@inria.fr In-Reply-To: <4FCCD429.40509@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="457990859-1962279338-1338826263=:63410" Subject: Re: [Caml-list] Re: submodules for Dynlink plugins? --457990859-1962279338-1338826263=:63410 Content-Type: text/plain; charset=us-ascii > 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 To: Dan Bensen 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 --457990859-1962279338-1338826263=:63410 Content-Type: text/html; charset=us-ascii
> 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

--457990859-1962279338-1338826263=:63410--