Yes. Actually, the CTM book shows how you can expand any particular
list comprehension into a combination of calls to flatten, map, and
filter. But this is rather tedious. The idea is to express the
concept the way you'd think of it mathematically (like traditional set
notation).
Python, Haskell, Clean and Erlang are among the languages which I know
offer list comprehensions -- and I find this syntactic sugar to be so
extraordinarily useful in writing clear, concise programs, that I now
consider it to be essential.
--Mark
On 3/17/06, Maximilian Wilson <[EMAIL PROTECTED]> wrote:
> On 3/17/06, Mark Engelberg <[EMAIL PROTECTED]> wrote:
> > Is there any sort of linguistic support for list comprehensions? I
> > don't see anything in the manual, but it seems like the kind of thing
> > I'd expect Mozart to have.
>
> A quick Google search tells me that list comprehensions are a
> combination of List.map and List.filter. I take it you want syntactic
> sugar to cut out the fun{$} definitions? Well, if we had macros, you
> could roll your own...
>
> Max Wilson
>
> --
> Be pretty if you are,
> Be witty if you can,
> But be cheerful if it kills you.
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users