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 77825BC6B for ; Thu, 22 Feb 2007 10:46:39 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.231]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1M9kcEr031650 for ; Thu, 22 Feb 2007 10:46:39 +0100 Received: by wr-out-0506.google.com with SMTP id i28so131360wra for ; Thu, 22 Feb 2007 01:46:38 -0800 (PST) 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=mCLxNxhr3OHgWRw3y3CR0IrPai7Aj+el444PY870097p8JFM8+G/MGpMKLEpYakJwtqLYO2dIokJ7IGFDOrAeIDN9fyDxz3ikbcTnBFlLjQ2X7ctLn27/ZpWiG25bLtaT3/44a7C/6KXcbD57nwycRRH9hKCvriKR1sCJnPwF3s= 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=lkkDaR/rk1hFmV11BRO3Rp0xVTtrg1ZPKBJeXObOI3gsZCGnIym6lAqCf26qfpmzXHEIZd5oXJfoCLb2K18mDNeBdFM8kMqMFCWa/FzMmTL1eihhO6Kb8gpBMq1dAT06+Ks1nhXoNPC8BZBLyyxRsy/lCV67Fzf5C/iM93R44sY= Received: by 10.114.12.9 with SMTP id 9mr174825wal.1172137596593; Thu, 22 Feb 2007 01:46:36 -0800 (PST) Received: by 10.114.183.4 with HTTP; Thu, 22 Feb 2007 01:46:36 -0800 (PST) Message-ID: Date: Thu, 22 Feb 2007 10:46:36 +0100 From: "Nicolas Pouillard" To: "Gabriel Kerneis" Subject: Re: [Caml-list] Record types "with" syntax and camlp4 Cc: caml-list@yquem.inria.fr In-Reply-To: <20070221193433.07f5981b@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070221193433.07f5981b@localhost> X-j-chkmail-Score: MSGID : 45DD667E.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45DD667E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 camlp:01 syntax:01 camlp:01 longident:01 expr:01 zsh:01 foo:01 foo:01 1.5:98 4.1:98 4.1:98 wrote:01 deprecated:01 caml-list:01 On 2/21/07, Gabriel Kerneis wrote: > Hi, > > the { x with y = z} syntax seems to be broken in camlp4. But i can't > find any information about it in the (deprecated ?) camlp4 manual. > Not br0ken, just different. For ambiguity reasons the expression before "with" needs parentheses. > 19:29 gabriel % cat record.ml > type t = { a : int ; b : float } ; > value x = > let s = {a=5 ; b= 1.5} in > {s with b = 4.1} ; { (s) with b = 4.1 }; > > 19:29 gabriel % camlp4rf record.ml > File "record.ml", line 4, characters 8-12: > Parse error: [fun_binding] expected after [label_longident] (in > [label_expr]) > zsh: exit 2 camlp4rf record.ml > > Any hint ? I can also give you a meta-hint for camlp4 stuffs and revised syntax: $ camlp4o -printer r -str '{ s with foo = bar }' { (s) with foo = bar; }; Camlp4 is a translator itself so if you now how to do some thing in the original syntax you can learn the revised one by asking to Camlp4 itself. Of course you can still ask questions on that list... Regards, -- Nicolas Pouillard