Version française
Home     About     Download     Resources     Contact us    
Browse thread
List comprehensions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] List comprehensions
On 8/18/07, skaller <skaller@users.sourceforge.net> 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 -->