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.0 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 13A62BC69 for ; Tue, 21 Aug 2007 00:55:48 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.236]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7KMtlmD005338 for ; Tue, 21 Aug 2007 00:55:47 +0200 Received: by nz-out-0506.google.com with SMTP id x7so489901nzc for ; Mon, 20 Aug 2007 15:55:46 -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=jD05IJ+DQDKZdWOsgnmTOOVbzmpxgMbUCCkQ2iS8MTF5rpZ9sqpChNhP12HSnFK6gVHfjD0A4awqeftoRyZRuva69uxCIWQLI+jM0evMzBhajBLUxRI1ZD1bnDuf2gIDfTjFpZ6Mpi41i/z1gYXDW2dGKtYHEKqVPBu90OiJHV0= 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=dXhBZkIgEQ4oT2szsmP3XyzJ4Jl2giQ5pwSr9lEYXcJtBCV0zWbZXiyDkEOa46yVwzhtkHtx2KlcwFNe71DZk2BB8ZAGE1QMyZiWPo+Didu1O93Zs8shE4Q+hCWYWsCKYpNzP8fvep+KYE4Lpn8C8OoiXiqLJTKVZk2LF5UctZ4= Received: by 10.142.179.12 with SMTP id b12mr672826wff.1187650545718; Mon, 20 Aug 2007 15:55:45 -0700 (PDT) Received: by 10.142.80.9 with HTTP; Mon, 20 Aug 2007 15:55:45 -0700 (PDT) Message-ID: Date: Mon, 20 Aug 2007 15:55:45 -0700 From: "Nathaniel Gray" To: skaller Subject: Re: [Caml-list] List comprehensions Cc: "Jon Harrop" , caml-list@yquem.inria.fr In-Reply-To: <1187448871.10363.69.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200708181528.18107.jon@ffconsultancy.com> <1187448871.10363.69.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 46CA1BF3.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46CA1BF3.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0100,:01 ocaml:01 ocaml:01 camlp:01 camlp:01 usr:01 usr:01 lib:01 sourceforge:01 wrote:01 wrote:01 parsing:01 parsing:01 caml-list:01 cma:01 On 8/18/07, skaller wrote: > On Sat, 2007-08-18 at 15:28 +0100, Jon Harrop wrote: > > I didn't know OCaml had list comprehensions built-in: > > > > $ ocaml camlp4oof.cma > > Objective Caml version 3.10.0 > > > > Camlp4 Parsing version 3.10.0 > > > > # [x + 2*x + x/2 | x <- [1; 2; 3; 4]];; > > - : int list = [3; 7; 10; 14] > > # > > > > Cool! :-) > > Since you're fishing, I'm biting -- what bait do you > need to catch a camlp4oof? I guess just 0.3.10. [n8gray@golux]% locate camlp4oof /usr/local/godi/bin/camlp4oof /usr/local/godi/bin/camlp4oof.opt /usr/local/godi/lib/ocaml/std-lib/camlp4/camlp4oof.cma [n8gray@golux]% rlwrap ocaml camlp4oof.cma Objective Caml version 3.10.0 Camlp4 Parsing version 3.10.0 # [x + 2*x + x/2 | x <- [1; 2; 3; 4]];; - : int list = [3; 7; 10; 14] # [x + 2*x + x/2 - y | x,y <- [1,2; 2,3; 3,4; 4,5]];; - : int list = [1; 4; 6; 9] -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->