"for" question (newbie)
Bill Spight
bspight at pacbell.net
Thu Sep 12 22:30:44 CEST 2002
Dear Denys,
Thank you for your quick response. :-)
> > At first glance, and upon checking the documentation, it seems like the
> > loop should traverse the cartesian product of L and its tail.
>
> I don't know where you got this idea.
>From an assumption of independence. ;-)
> "Upon checking the documention",
> ahem, you'll find (in the document "Loop Support"):
>
> In order to provide convenient syntax for loops, two new
> keywords have been introduced in Mozart 1.1.0: for and do. Thus,
> a new statement is introduced in the Oz language and its syntax
> is:
>
> for Declarations do ... end
>
> where Declarations is a sequence of 0 or more iterator and
> feature declarations. An iterator has the form: Pat in Generator
> where Generator describes how to generate the successive values
> for pattern Pat whose variables are local to the loop. The
> generators are stepped in parallel and the loop terminates as
> soon as one of the generators runs out of values.
>
> Notice the sentence "generators are stepped in parallel" :-) I
> actually added this sentence at Joachim's request to attempt to remove
> a possible ambiguity. I guess I failed :-(
Stupid me! I actually looked at that twice without getting it. :-(
FWIW, "in parallel" with that meaning is unfamiliar to me. "In
lock-step", "together", "at the same time", and "in tandem" are more
familiar. But, of course, that simply reflects my personal ignorance.
Anyway, thanks for clearing things up. :-) Sorry for the bother.
Best regards,
Bill
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-users
mailing list