From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B728ABB83 for ; Wed, 5 Jul 2006 01:07:48 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k64N7n9F003272 for ; Wed, 5 Jul 2006 01:07:49 +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 BAA19564 for ; Wed, 5 Jul 2006 01:07:48 +0200 (MET DST) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.196]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k64N7lsu015512 for ; Wed, 5 Jul 2006 01:07:48 +0200 Received: by nz-out-0102.google.com with SMTP id m7so802712nzf for ; Tue, 04 Jul 2006 16:07:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tVDbSrssTCKvYnHdInHxTrVpzvq/Hq2GQeGRbtksLXvzCWgZCegNxsi+tV9CKTOt0w/zXLguo5a318rOLwi+ChVnrhZOu646YomQfxhwP1g/av5ML7C/FPcjT9CSP8JF0yE6bAW6kO9kDXi8Ii6lni3PCfjyO6u6wyEQ71ls7Q8= Received: by 10.36.24.20 with SMTP id 20mr5486873nzx; Tue, 04 Jul 2006 16:07:46 -0700 (PDT) Received: by 10.36.101.10 with HTTP; Tue, 4 Jul 2006 16:07:46 -0700 (PDT) Message-ID: Date: Wed, 5 Jul 2006 11:07:46 +1200 From: "Jonathan Roewen" To: "Matt Gushee" Subject: Re: [Caml-list] revised syntax and immediate objects Cc: caml-list@inria.fr In-Reply-To: <44AAF164.20406@gushee.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44AAF164.20406@gushee.net> X-j-chkmail-Score: MSGID : 44AAF4C3.001 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 44AAF4C5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44AAF4C3.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; syntax:01 camlp:01 syntax:01 camlp:01 ocaml:01 topfind:01 pcaml:01 rhs:01 expr:01 wrote:01 unbound:01 caml-list:01 expression:01 hmm:02 revised:02 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=RCVD_BY_IP autolearn=disabled version=3.0.3 > > I'd like to try make a camlp4 syntax extension that uses immediate > > objects, > > I've done that. I'll show you the key section of the code below, and I > can send you the complete file if you like. It may not be 100% correct, > but I've been using it in an application and so far it works. I don't > know if I can *explain* it, though ... I wrote it several months ago, > and I'm coming to think that CamlP4, like Perl, is a write-only language ;-) Hmm, I'm getting an error trying to use class_str_item (ocaml 3.09.2): # #use "topfind";; # #camlp4o;; # #require "camlp4.extend";; # open Pcaml;; # let gen_method loc field = let obj = "obj" in <:class_str_item< method $lid:field$ = $lid:obj$#$lid:field$; >>;; Unbound quotation: "class_str_item";; (The rhs of the expression is temporary, just for testing) Also, I similarly get similar error for "class_expr".