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 PAA05132; Mon, 4 Feb 2002 15:11:55 +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 PAA04461 for ; Mon, 4 Feb 2002 15:11:54 +0100 (MET) Received: from tcs.inf.tu-dresden.de (tcs.inf.tu-dresden.de [141.76.75.101]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g14EBi100120 for ; Mon, 4 Feb 2002 15:11:48 +0100 (MET) Received: from ithif51 (ithif51 [141.76.75.51]) by tcs.inf.tu-dresden.de (8.12.0.Beta7/8.12.0.Beta7) with ESMTP id g14EBbQf007590; Mon, 4 Feb 2002 15:11:38 +0100 (MET) Received: from tews by ithif51 with local (Exim 3.12 #1 (Debian)) id 16XjqL-0007fv-00; Mon, 04 Feb 2002 15:11:37 +0100 From: Hendrik Tews MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15454.38553.300800.53941@gargle.gargle.HOWL> Date: Mon, 4 Feb 2002 15:11:37 +0100 (CET) To: Shivkumar Chandrasekaran Cc: caml-list@inria.fr Subject: [Caml-list] camlp4o problem (was: otags problem) In-Reply-To: <9BE7FA48-1771-11D6-A336-003065BDAA76@ece.ucsb.edu> References: <9BE7FA48-1771-11D6-A336-003065BDAA76@ece.ucsb.edu> X-Mailer: VM 6.75 under Emacs 20.7.2 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Shivkumar Chandrasekaran writes: Date: Fri, 1 Feb 2002 16:12:56 -0800 Subject: [Caml-list] otags problem In my program I have an operator named ( <:> ). Unfortunately otags 3.04.3 reports a lexing error (character '<' expected) on that line. ocaml 3.04 itself has no problem with it. Can anybody help me work around it? The problem is that otags uses camlp4o to parse the ocaml sources. Sometimes camlp4o is different from ocaml. You just hit one of these cases: ithif51 ocaml 15> ledit ocaml Objective Caml version 3.04 # let ( <:> ) x y = x + y;; val ( <:> ) : int -> int -> int = # #load "camlp4o.cma";; Camlp4 Parsing version 3.04 # let ( <:> ) x y = x + y;; Toplevel input: # let ( <:> ) x y = x + y;; ^ Lexing error: character '<' expected This difference seems to be a feature: in camlp4 "<:" starts a quotation. The only solutions that I see are the following: - use an infix operator that works in ocaml and in camlp4 - rewrite otags ;-) For Daniel de Rauglaudre: Because normal ocaml users are now sometimes requested to use camlp4o for parsing (for instance for streams) I think it makes sense to provide a camlp4 parser that is _exacly_ ocaml. Maybe by placing the quotation syntax in a separate file, say pa_q.cmo? Bye, Hendrik ------------------- 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