From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA28618; Sat, 27 Mar 2004 16:47:39 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 QAA28605 for ; Sat, 27 Mar 2004 16:47:38 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2RFmFKW005200 for ; Sat, 27 Mar 2004 16:48:16 +0100 Received: from [192.168.1.200] (ppp113-158.lns1.syd3.internode.on.net [150.101.113.158]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i2RFlUUK046123; Sun, 28 Mar 2004 02:17:30 +1030 (CST) Subject: Re: [Caml-list] Delaying module initialization From: skaller Reply-To: skaller@users.sourceforge.net To: Richard Jones Cc: caml-list In-Reply-To: <20040327112140.GA3124@redhat.com> References: <20040326165943.GA18734@redhat.com> <20040327.022627.38703728.yoriyuki@mbg.ocn.ne.jp> <20040326184424.GA20895@redhat.com> <8765cre8el.dlv@vanicat.homelinux.org> <20040327101944.GA1941@redhat.com> <20040327121832.B29840@pauillac.inria.fr> <20040327112140.GA3124@redhat.com> Content-Type: text/plain Message-Id: <1080402449.4708.141.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 28 Mar 2004 02:47:29 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 2004:99 lwp:01 useragent:99 dynamically:01 bytecodes:01 dynamically:01 lwp:01 useragent:99 bytecodes:01 9660:01 glebe:01 invoke:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 391 On Sat, 2004-03-27 at 22:21, Richard Jones wrote: > On Sat, Mar 27, 2004 at 12:18:32PM +0100, Xavier Leroy wrote: > > A nicer way to write the above is > > > > let init = lazy (eval "use LWP::UserAgent") > > let somefun x y = Lazy.force init; ... > > Ah yes, that's nice! Yes but it won't work. The problem with apache plugins is that the interpreted script in an HTML page can invoke *arbitrary* scripts. If those scripts are interpreted dynamically then the Ocaml bytecodes for them must also be loaded dynamically, and then the Perl being wrapped will also be loaded dynamically. So there is no use of this idiom: it is quite enough to just write: let init = eval "use LWP::UserAgent" in the dynamically loaded Ocaml bytecode. The problem is NOT to dynamically load the Perl, but to dynamically load the Ocaml bytecodes required by a given HTML page (and no others). -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners