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 FAA13448; Tue, 5 Oct 2004 05:46:18 +0200 (MET DST) 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 FAA10027 for ; Tue, 5 Oct 2004 05:46:16 +0200 (MET DST) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i953kDSv010090 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 5 Oct 2004 05:46:16 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id D688414946 for ; Tue, 5 Oct 2004 13:46:09 +1000 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26913-07 for ; Tue, 5 Oct 2004 13:46:09 +1000 (EST) Received: from pulp.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id C508AB2C for ; Tue, 5 Oct 2004 13:46:09 +1000 (EST) Received: by pulp.anu.edu.au (Postfix, from userid 1560) id 7F25725B791; Tue, 5 Oct 2004 13:45:09 +1000 (EST) Date: Tue, 5 Oct 2004 13:45:09 +1000 From: Pietro Abate To: ocaml ml Subject: [Caml-list] camlp4 question... Message-ID: <20041005034509.GA12748@pulp.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at concorde with ID 41621905.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pietro:01 abate:01 pietro:01 abate:01 camlp:01 failwith:01 expr:01 lident:01 expr:01 failwith:01 ffff:99 patt:01 rec:01 match:02 philosophy:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all, I'd like to write a small extension to transform let f = ... in let f new_id = match new_id with |[a;b;c] -> ... |_ -> failwith "wrong arguments" I've tried with something like: expr: LEVEL "simple" [[ "let"; OPT "rec"; "<"; l = LIST1 LIDENT; ">"; $list:pel$ "in" e = expr -> <:expr< let .... = function [] -> failwith "ffff" | $list:l$ -> $e$ >> ]]; but I'm stuck... In particular, how can I parse $list:pel$ ? pel = LIST patt ? thanks, p -- ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html ------------------- 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