From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A6E39D45F for ; Tue, 1 Nov 2005 14:54:46 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jA1Dskcr030550 for ; Tue, 1 Nov 2005 14:54:46 +0100 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 OAA31103 for ; Tue, 1 Nov 2005 14:54:45 +0100 (MET) Received: from mail.tcs.inf.tu-dresden.de (tcs01.inf.tu-dresden.de [141.76.75.1]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA1DsjWG017048 for ; Tue, 1 Nov 2005 14:54:45 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.tcs.inf.tu-dresden.de (Sun Java System Messaging Server 6.1 HotFix 0.06 (built Nov 11 2004)) with ESMTP id <0IPA0066C3Z9UQ00@mail.tcs.inf.tu-dresden.de> for caml-list@inria.fr; Tue, 01 Nov 2005 14:54:45 +0100 (MET) Received: from tcs01.inf.tu-dresden.de ([127.0.0.1]) by localhost (mail.tcs.inf.tu-dresden.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12013-07 for ; Tue, 01 Nov 2005 14:54:44 +0100 (MET) Received: from ithif59.inf.tu-dresden.de (ithif59.inf.tu-dresden.de [141.76.75.59]) by mail.tcs.inf.tu-dresden.de (Sun Java System Messaging Server 6.1 HotFix 0.06 (built Nov 11 2004)) with ESMTPS id <0IPA006H23Z8UG00@mail.tcs.inf.tu-dresden.de> for caml-list@inria.fr; Tue, 01 Nov 2005 14:54:44 +0100 (MET) Received: from tews by ithif59.inf.tu-dresden.de with local (Exim 4.50) id 1EWwb6-0000pS-I2 for caml-list@inria.fr; Tue, 01 Nov 2005 14:54:44 +0100 Date: Tue, 01 Nov 2005 14:54:44 +0100 From: Hendrik Tews Subject: Re: [Caml-list] Strange output from Camlp4 In-reply-to: <436273A1.9030104@gushee.net> To: caml-list@inria.fr Message-id: MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Virus-Scanned: amavisd-new at tcs.inf.tu-dresden.de References: <436273A1.9030104@gushee.net> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-Miltered: at nez-perce with ID 436773A6.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 436773A5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 caml-list:01 val:01 mutable:01 expander:01 mlast:01 mlast:01 impl:01 expr:01 bug:01 syntax:01 parser:01 syntax:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Matt Gushee writes: I have a file, ox.ml, whose contents look like this: let conf = object val mutable data:(string * string) list = [] method get k = List.assoc k data end An immediate object, this is a bit more difficult. Note that the quotation expander q_MLast contains no rules for immediate objects. Further, pr_o.ml and pr_r.ml do not contain MLast.ExObj, the ast constructor for immediate objects, so when pretty printing an immediate object, you end up with this code: | e -> fun curr next _ k -> [: `not_impl "expr" e :] ]}]; BTW, that is deliberately a let binding rather than a class definition. Is that not supposed to work? I would say yes. You should submit a bug report about it. To learn about the revised syntax you have to study the parser pa_r.ml ... or read about what I have found out at http://wwwtcs.inf.tu-dresden.de/~tews/ocamlp4/camlp4-undoc.html The translation to revised syntax of your example is as follows: value conf = object value mutable data: list (string * string) = []; method get k = List.assoc k data; end; Why do you need the revised syntax at all? If you just want to use quotations, you can use quotations in the original syntax, see http://wwwtcs.inf.tu-dresden.de/~tews/ocamlp4/ocamlp4.html Version 0.2 does not have immediate objects, but I have done immediate objects already and I can release it if you need it. I plan to upgrade to 3.09 as soon as I find some time.