From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA19653 for caml-red; Sat, 30 Dec 2000 22:43:29 +0100 (MET) 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 VAA17835 for ; Sat, 30 Dec 2000 21:53:06 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eBUKr3529182; Sat, 30 Dec 2000 21:53:03 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id VAA02047; Sat, 30 Dec 2000 21:53:03 +0100 Date: Sat, 30 Dec 2000 21:53:03 +0100 From: Daniel de Rauglaudre To: Chris Hecker Cc: caml-list@inria.fr Subject: Re: status of some big "important" features? Message-ID: <20001230215303.A2040@verdot.inria.fr> References: <4.3.2.7.2.20001226151428.00b2f680@shell16.ba.best.com> <4.3.2.7.2.20001226151428.00b2f680@shell16.ba.best.com> <20001228101047.A27850@verdot.inria.fr> <4.3.2.7.2.20001230112049.00ba2b60@shell16.ba.best.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0us In-Reply-To: <4.3.2.7.2.20001230112049.00ba2b60@shell16.ba.best.com>; from checker@d6.com on Sat, Dec 30, 2000 at 11:30:57AM -0800 Sender: weis@pauillac.inria.fr Hi, On Sat, Dec 30, 2000 at 11:30:57AM -0800, Chris Hecker wrote: > type foo = {bar:float; baz:int };; > let a = {bar = 1.;baz = 1};; > print_members_camlp4 a;; > > Where print_members_camlp4 is hooked by camlp4 to iterate over the > members of whatever record was passed to it (or error at compile > time if it's not a record)? That's not possible? Camlp4 does not know what a type definition is: for it, it is just a syntax thing. Therefore, in the line "print_member_camlp4 a", Camlp4 does not know what "a" is: for it, it is just "the identifier a", that's all. The fact that it is a variable previously defined of type "foo" is typing. If you want to treat that at Camlp4 time, you have to write a types inference algorithm. A compiler... -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/