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 JAA22583; Tue, 22 Jan 2002 09:47:16 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA22828 for ; Tue, 22 Jan 2002 09:47:15 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0M8lEf27431 for ; Tue, 22 Jan 2002 09:47:14 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id JAA01921 for caml-list@inria.fr; Tue, 22 Jan 2002 09:47:14 +0100 Date: Tue, 22 Jan 2002 09:47:14 +0100 From: Daniel de Rauglaudre To: OCAML Subject: Re: [Caml-list] p4 (newbie) question Message-ID: <20020122094714.B1462@verdot.inria.fr> References: <86d703r2cg.fsf@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <86d703r2cg.fsf@speakeasy.org>; from itz@speakeasy.org on Mon, Jan 21, 2002 at 10:22:23AM -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Mon, Jan 21, 2002 at 10:22:23AM -0800, Ian Zimmerman wrote: > shouldn't there be 2 distinct nodes like this > > <:expr< $e1$ . $e2$ >> : access in records > <:expr< $me1$ . $e2$ >> : access in modules No: in these two quotations, e1, e2, me1, e2 are not some kind of "keywords" like you seem to believe, but variables. These quotations are (resp.) equivalent to: MLast.ExAcc (loc, e1, e2) MLast.ExAcc (loc, me1, e2) which cannot discriminate according to the cases record/modules as you see. The difference is done by the first parameter when it represents (or not) an uppercase identifier: MLast.ExAcc (loc, MLast.ExUid loc s, e2) which can be written with quotations as: <:expr< $uid:s$ . $e2$ >> That is (above) the code of contructing a module access if s is a string holding the module name and e2 is an expression. If you already know the name of your module, and if it is e.g. Foo, you can write it: <:expr< Foo . $e2$ >> which is equivalent to: MLast.ExAcc (loc, MLast.ExUid loc "Foo", e2) Note that you don't need to know the form with MLast.ExAcc, MLast.ExUid and so on, but it is just to explain you what the quotations represent. -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr