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.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 868AFBC6C for ; Tue, 1 May 2007 09:20:51 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l417Ko6w010131 for ; Tue, 1 May 2007 09:20:51 +0200 Received: by nz-out-0506.google.com with SMTP id l8so2310316nzf for ; Tue, 01 May 2007 00:20:50 -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=cTkF+FOV6p7tKfquz7F3y401Eucfrm+GSAyRctuLcwpcIUxUxTjqK5IfxZqFbLEwgLn3CwPvIhTmmAEf8SAiKLCbMyQByiJn1+bjp5YIg8azNaSnp4m3lrWmbrIMAPeJXnP/0VctU2w2J7ukgTf8JWyadk3zdRqwC3RLVfezo/w= 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=iX7ektWSFsf10bi0sFCyc53mw7/x+XebLF4iEvTsoQbpEhImEolZBjzcgt5ANiVWXDk/uIHlFfBlMlYITfGqrkiLF1FnU9FHgnn2k3NTEhT5NJMYSCRWIm4ZOoRB8ZGwGLjnMlyeaRbvyR+2yY9+2tlJBoWgzXnd0pZeIk91TnI= Received: by 10.114.75.1 with SMTP id x1mr2273665waa.1178004050101; Tue, 01 May 2007 00:20:50 -0700 (PDT) Received: by 10.114.181.18 with HTTP; Tue, 1 May 2007 00:20:50 -0700 (PDT) Message-ID: Date: Tue, 1 May 2007 09:20:50 +0200 From: "Nicolas Pouillard" To: "Joel Reymont" Subject: Re: Upgrading sexplib-2.7.0 to camlp4 3.10 Cc: "Caml List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <220DCCF0-FD2D-4116-8E30-992C1AD3FE95@gmail.com> <72EB1952-F2C8-44AC-B1A6-7D8CE5F4A157@gmail.com> X-j-chkmail-Score: MSGID : 4636EA52.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 4636EA52.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 expr:01 expr:01 camlp:01 wrote:01 assert:01 compiles:01 ast:02 seems:03 loc:03 let:03 variable:06 upgrading:06 alas:07 function:08 On 4/30/07, Joel Reymont wrote: > This replacement compiles. > > Should I assume it to be correct? > > let tuplify_exprs _loc = function > | [] -> assert false > | [expr] -> expr > | exprs -> <:expr< ( exprs ) >> No that one is not correct your are building the program with the free variable `exprs'. The correct code should be: | expr :: exprs -> <:expr< ( $expr$, $list:exprs$ ) >> Which is a sugar for: | expr :: exprs -> <:expr< ( $expr$, $Ast.exCom_of_list exprs$ ) >> Alas camlp4of seems to don't support that sugar well, so fall back the second one. -- Nicolas Pouillard