From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 3EB85BCAE for ; Fri, 15 Jul 2005 06:10:38 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6F4Ab51031983 for ; Fri, 15 Jul 2005 06:10:37 +0200 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 GAA10452 for ; Fri, 15 Jul 2005 06:10:37 +0200 (MET DST) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6F4AasK010750 for ; Fri, 15 Jul 2005 06:10:37 +0200 Received: from frontend2.messagingengine.com (frontend2.internal [10.202.2.151]) by frontend1.messagingengine.com (Postfix) with ESMTP id 78152CBE37A; Fri, 15 Jul 2005 00:10:36 -0400 (EDT) X-Sasl-enc: pvwl31alN2b4Miy2b/ORAAhj4Pf2bJPihabreFttXTJg 1121400635 Received: from [172.16.13.142] (burnham.ljcrf.edu [192.231.106.2]) by frontend2.messagingengine.com (Postfix) with ESMTP id E6B3F570147; Fri, 15 Jul 2005 00:10:32 -0400 (EDT) Date: Thu, 14 Jul 2005 21:10:23 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@localhost To: Marc Lasson Cc: caml-list@inria.fr Subject: Re: [Caml-list] OO syntax extension In-Reply-To: <42D71430.5030601@free.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 42D7373D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42D7373C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 syntax:01 syntax:01 syntaxes:01 val:01 mutable:01 expr:01 accessor:01 expr:01 mutable:01 accessor:01 ocamlc:01 -pp:01 cmo:01 mlast:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: On Fri, 15 Jul 2005, Marc Lasson wrote: > Jacques Garrigue wrote: > > >OO syntax extension > > Some camlp4 syntax extensions to write more compact code using > > objects. The new syntaxes are > > * val [mutable] x = expr with (reader|writer|accessor) > > generates code for an x and a set_x method, like in ruby. > > * obj#x <- expr > > generates a call to the set_x method. > > * {| [mutable] f1 = expr1; ...; [mutable] fn = exprn |} > > generates an immediate object with the above fields and the > > corresponding accessor methods. You may also include inherit > > declarations. > > > I am very interested in your OO syntax extension but i did not succeed > to compile it. > I get the following error: > > marc@georgie:~$ ocamlc -I +camlp4 -c -pp 'camlp4o pa_extend.cmo > q_MLast.cmo' pa_oo.ml > File "pa_oo.ml", line 12, characters -249--249: > Unbound value loc > > The error's position looks very weird. Since i can't speak camlp4, i'm > unable to fix it. Pass the -loc _loc option to camlp4o and it should work. See http://martin.jambon.free.fr/extend-ocaml-syntax.html#loc Martin -- Martin Jambon, PhD http://martin.jambon.free.fr