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 DAA01982; Wed, 9 Oct 2002 03:52:40 +0200 (MET DST) 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 DAA01977 for ; Wed, 9 Oct 2002 03:52:38 +0200 (MET DST) Received: from anumail4.anu.edu.au (anumail4.anu.edu.au [150.203.2.44]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g991qZD13897 for ; Wed, 9 Oct 2002 03:52:37 +0200 (MET DST) Received: from zed.cipputi.it (rsisedhcp-166.anu.edu.au [150.203.126.166]) by anumail4.anu.edu.au (8.12.4/8.12.4) with ESMTP id g991qWwT023077 for ; Wed, 9 Oct 2002 11:52:32 +1000 (EST) Received: from zed.cipputi.it (zed [127.0.0.1]) by zed.cipputi.it (8.12.6/8.12.6/Debian-6) with ESMTP id g991oPhi011655 for ; Wed, 9 Oct 2002 11:50:25 +1000 Received: (from abate@localhost) by zed.cipputi.it (8.12.6/8.12.6/Debian-6) id g991oNAX011652 for caml-list@inria.fr; Wed, 9 Oct 2002 11:50:23 +1000 Date: Wed, 9 Oct 2002 11:50:23 +1000 From: Pietro Abate To: Ocaml Subject: [Caml-list] Caml4p... help Message-ID: <20021009015023.GA10937@zed> Mail-Followup-To: Pietro Abate , Ocaml Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Austrialian National University) X-Spam-Status: Scanned X-Spam-Score: (1.1) X-Spam-Tests: DOUBLE_CAPSWORD X-Scanned-By: MIMEDefang 2.15 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk hi everybody, I've just started playing with Caml4p today and I'm already at a dead end. My goal is to transform this syntax str pc : [a;b;c] into a declaration like that. let pc_str = `Forall [| `Rule a; `Rule b; `Rule c |] extending (and in the future restricting) the caml syntax. I wrote this but I've problems compiling it. It says: ocamlc -c -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I /usr/lib/ocaml/camlp4 str.ml File "str.ml", line 18, characters 2-10: This expression has type unit but is here used with type MLast.expr make: *** [str.cmi] Error 2 of course the problem in about the "str" type. But I haven't still figured out why... Je vous remercie d'avance. p ----------------------- str.ml ------------------------ (*pp camlp4o pa_extend.cmo q_MLast.cmo *) open Pcaml;; type kind = [ |`Rule of string |`First of kind array |`Forall of kind array ] let str = Grammar.Entry.create gram "str";; EXTEND expr: AFTER "top" [[ "str"; n = LINDENT; ":"; s = str -> <:expr< let $lid:n$ = $s$ in $lid:n$ >> ]]; str: [[ | n = LINDENT -> <:expr<`Rule $str:n$>> | "["; s = LIST1 str SEP ";"; "]" -> <:expr<`Forall [|$list:s$|] >> | "{"; s = LIST1 str SEP ";"; "}" -> <:expr<`First [|$list:s$|] >> ]]; END;; -- pgp key: 1024D/8A091922 2000-10-18 Pietro Abate Key fingerprint = 5111 D91B 5E0C 5CE6 FDA3 5EF4 6120 E18E 8A09 1922 public key avalaible via public key server at wwwkeys.eu.pgp.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