Dear Terrence,
> Re:
> http://www.mozart-oz.org/documentation/tutorial/node5.html#control.anonymous
>
> Just as a comment, when I look at the For and ForAll/2 control
> abstractions, they seem limited to using functions of arity 1. I
> basically compare them to similar procedures in Scheme and note that I
> could use similar things in Scheme with procedures of any arity.
There is syntactic sugar for for-loops in Oz. You can easily iterate over
multiple lists like this:
for X in [1 2 3] Y in [a b c] do
{System.show X#Y}
end
> Other languages like Haskell, might use zip or zipWith to apply a function
> of a particular arity instead of being limited to procedures of arity 1.
There is "List.zip" which works like Haskell's zipWith.
It would not be difficult to write a function ForAllN which takes a list of N
lists and a n-ary procedure.
Wolfgang
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users