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 GAA23202; Sun, 13 Jan 2002 06:23:08 +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 GAA23152 for ; Sun, 13 Jan 2002 06:23:07 +0100 (MET) Received: from c007.snv.cp.net (c007-h015.c007.snv.cp.net [209.228.33.222]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g0D5N6T17987 for ; Sun, 13 Jan 2002 06:23:06 +0100 (MET) Received: (cpmta 27619 invoked from network); 12 Jan 2002 21:23:01 -0800 Received: from 65.187.194.217 (HELO vaiobambino) by smtp.directvinternet.com (209.228.33.222) with SMTP; 12 Jan 2002 21:23:01 -0800 X-Sent: 13 Jan 2002 05:23:01 GMT From: "Jeff Henrikson" To: Subject: [Caml-list] camlp4: LIST1 construct on record patterns Date: Sun, 13 Jan 2002 00:38:49 -0500 Message-ID: <005401c19bf4$93d638a0$0b01a8c0@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk In camlp4, I don't seem to be able to break apart a record pattern in any way. I must not understand how to use LIST1 properly: let try_extend _ = let cons = "Bogus" in let test_label_eq = Grammar.Entry.find expr "test_label_eq" in let lbl_expr_list = Grammar.Entry.find expr "lbl_expr_list" in EXTEND expr: LEVEL "simple" [ [ $cons$; "{"; memb = LIST1 lbl_expr_list SEP ";" ; "}" -> <:expr<{$list:memb$}>> ] ] ; END;; try_extend "junk";; ... [ [ $cons$; "{"; memb = LIST1 reenter SEP ";" ; "}" -> <:expr<{$list:memb$}>> ] ] ^^^^ ; END;; This expression has type Obj.t list but is here used with type (MLast.patt * MLast.expr) list Isn't an Obj.t a completely opaque meaningless entity? Substituting test_label_eq for lbl_expr_list makes no difference. I got those identifiers by running: Grammar.Entry.print expr;; which doesn't tell me the meaning of test_label_eq, and Grammar.Entry.print (Grammar.Entry.find expr "test_label_eq");; doesn't tell me anything either. Do I just have to go read the source code to know their meaning? I would have except I guess it doesn't come default now that camlp4 is part of ocaml. Jeff Henrikson ------------------- 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