From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 24723BC69 for ; Mon, 19 Mar 2007 21:04:31 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2JK4THX008530 for ; Mon, 19 Mar 2007 21:04:30 +0100 Received: by wr-out-0506.google.com with SMTP id 60so1665689wri for ; Mon, 19 Mar 2007 13:04:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=o0mYQx7kd5tAkbzDSZYYYQgGnuXNd1bWUpjNuzzpThqO1p5S/pzc1tl0HBWziPshXIl+WZD7J36uSWn2UvC7uV9AOEZjCkeyesohsH+TjMFy0XRHDJuRw+n6tsIVta2ehjH5tIV7q+l4VuErqavWfBHUPDHBAGLWo7frUkL1RX0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XbLgPQwjkBg6CIBGi+5GoWHvuafyvptmT1lT1LED8Z1nHw5yiInDNuwJ9OpRo9M3n2oAuk6N3bcp37dJ8jnFodN+zG5LhAli/YrWwWq57JlTbv61SYNpsU6wKUiLdrPXQ+PZiVKLbxVCxDDksnq7ypqp0m6WnlH3lN7zeNyafis= Received: by 10.90.69.8 with SMTP id r8mr4659555aga.1174334668860; Mon, 19 Mar 2007 13:04:28 -0700 (PDT) Received: by 10.114.183.4 with HTTP; Mon, 19 Mar 2007 13:04:28 -0700 (PDT) Message-ID: Date: Mon, 19 Mar 2007 21:04:28 +0100 From: "Nicolas Pouillard" To: "michel levy" Subject: Re: [Caml-list] camlp4 and dirac notation Cc: caml-list@inria.fr In-Reply-To: <45FECE85.8080403@imag.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45FECE85.8080403@imag.fr> X-j-chkmail-Score: MSGID : 45FEECCD.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45FEECCD.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 notation:01 ocaml:01 syntax:01 camlp:01 notation:01 expr:01 expr:01 readable:01 lident:01 wrote:01 caml-list:01 michel:01 michel:01 expression:02 On 3/19/07, michel levy wrote: > I try to modify the ocaml syntax with camlp4 to add the Dirac notation > |v >. > Have you any solution ? > > I have tried with > EXTEND > expr : LEVEL "simple" > [["|"; e=expr ;">" -> <:expr< ket $e$>>] e = expr LEVEL "simple" You don't want to allow any expression here since it will be ambiguous with the '>' operator. You even perhaps don't want an expression here |(f x y z)> seems not really readable, you can allow only identifiers. [["|"; id = LIDENT ;">" -> <:expr< ket $lid:id$>> ]] Hope this helps, -- Nicolas Pouillard