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.4 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 172E0BC69 for ; Tue, 31 Jul 2007 19:50:18 +0200 (CEST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6VHoHfI026508 for ; Tue, 31 Jul 2007 19:50:17 +0200 Received: by nf-out-0910.google.com with SMTP id g13so315986nfb for ; Tue, 31 Jul 2007 10:50:17 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=c8qvU1LQMIOsnC7a2XXZY+y5vylmB6xPi5PVMoEYZHNCdtxHChsMSFKKXZBe2ZWSKdSdFBgYd9zdyphTxGeIg+0xUF427T5niOkx87rnBmyyBTSn+unX3mCdneCfkAxJc+48uc17AZnjYWPAlXG+aVNupmIGnWgcnEE1bxY6kyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=t3C+jNmXTqRxhssj29iJAGmL+C0xQUhAG2BdSJpA2IQX0fJ2lfibm0Z/Lrlpu/1EAOUdFmo7IeSYkv6yyXZDcONbWMt2q2waM4mrF/S8xlIUZfiSd+ZNfDeTS9rJBfBJDD5oIZFkD1APl79zis2yhw+VpKaNztS0rtTQHPLvKHw= Received: by 10.86.65.11 with SMTP id n11mr4878631fga.1185904217369; Tue, 31 Jul 2007 10:50:17 -0700 (PDT) Received: from localhost ( [86.200.251.119]) by mx.google.com with ESMTPS id f19sm3303594fka.2007.07.31.10.50.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jul 2007 10:50:14 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Tue, 31 Jul 2007 19:50:16 +0200 Date: Tue, 31 Jul 2007 19:50:15 +0200 To: Gabriel Kerneis Cc: caml-list@inria.fr Subject: Re: [Caml-list] [Camlp4][trivial ?] Anonymous bind (for monads) Message-ID: <20070731175015.GA10482@jiyu.gnu> Mail-Followup-To: Julien Moutinho , Gabriel Kerneis , caml-list@inria.fr References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) From: Julien Moutinho X-j-chkmail-Score: MSGID : 46AF7659.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46AF7659.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 trivial:01 monads:01 0200,:01 expr:01 expr:01 foo:01 foo:01 monads:01 camlp:01 wrote:01 caml-list:01 match:02 guess:04 jul:05 On Tue, Jul 31, 2007 at 06:55:05PM +0200, Gabriel Kerneis wrote: > EXTEND Gram > expr: LEVEL "top" > [[ t=expr; "foo"; f=expr -> > <:expr< > Lwt.bind $t$ (fun () -> $f$) > >>]]; > END > end > [...] > But if I change "foo" to ">>" (which is the usual way to write an > anonymous bind for monads), it doesn't work anymore. I first thought the > reason was that ">>" is also the symbol for closing a quotation, but > trying "++" instead proved useless as well. > > I'm certainly not a camlp4 guru so... what am I missing? My guess is that the first [t=expr] swallows the ">>". You can try "->" or "|" against which [expr] does not match, but I think it is not advisable to use them in a bigger program. However, I'm sure that Mr.Pouillard will be happy to enlight us on how to use ">>". HTH a little.