caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* List comprehensions
@ 2007-08-18 14:28 Jon Harrop
  2007-08-18 14:44 ` [Caml-list] " Joel Reymont
  2007-08-18 14:54 ` skaller
  0 siblings, 2 replies; 7+ messages in thread
From: Jon Harrop @ 2007-08-18 14:28 UTC (permalink / raw)
  To: caml-list


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! :-)

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?e


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-22  8:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-18 14:28 List comprehensions Jon Harrop
2007-08-18 14:44 ` [Caml-list] " Joel Reymont
2007-08-18 14:46   ` Jon Harrop
2007-08-19 10:26   ` Nicolas Pouillard
2007-08-18 14:54 ` skaller
2007-08-20 22:55   ` Nathaniel Gray
2007-08-22  8:54     ` Adrien

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).