Maximilian Wilson 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?
How about using collect
(http://www.mozart-oz.org/documentation/loop/node2.html#label5)?
This is how I would browse the list of tuples I#J such that 1=<I,J=<10
and I mod J =0:
{Browse
for I in 1..10 collect:C do
for J in 1..10 do
if I mod J==0 then {C I#J} end
end
end}
Luis
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users