Re: LOOP blows!
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Thu, 7 Feb 2008 23:33:20 -0800 (PST)
On Feb 7, 10:19 pm, Madhu <enom...@xxxxxxxx> wrote:
* Kaz Kylheku Wrote on Thu, 7 Feb 2008 21:03:21 -0800 (PST):
| Now, if I had
|
| FOR X = '(1 2 3) AND Y IN X
|
| then you would have a case. Now they are parallel, and so Y iterates
| using the value of X that existed before the assignment of '(1 2 3),
| the initial NIL. Thus the FOR Y IN clause instantly terminates and the
| loop is dead on arrival.
No no no! LOOP FOR X = '(1 2 3) AND Y IN X is just wrong syntax. It is
not allowed by LOOP. your mplementation is horrible if it lets it
through.
The two `for' clauses being connected are different. the
second clause is a for-as-in-list clause.
It isn't wrong syntax. But it's not treated how I described, either.
In fact, it's an unbound variable (a semantic problem, occuring once
the syntax is accepted and translated, and the expansion is
evaluated).
The FOR-AS clauses must precede the other body clauses because they
establish bindings for variables used in those clauses. One FOR clause
also establishes bindings for a following FOR clause. Here, the use of
X is not established by any lexically prior clause.
But it's not wrong syntax due to the subclauses being different kinds.
The LOOP grammar does generates heterogeneous FOR clauses, and there
is no other constraint specified to rule them out.
.
- References:
- LOOP blows!
- From: Kaz Kylheku
- Re: LOOP blows!
- From: Maciej Katafiasz
- Re: LOOP blows!
- From: Kaz Kylheku
- Re: LOOP blows!
- From: Madhu
- Re: LOOP blows!
- From: Kaz Kylheku
- Re: LOOP blows!
- From: Madhu
- LOOP blows!
- Prev by Date: Re: LOOP blows!
- Next by Date: Re: OT: Rails is shitty [was top down programming in a bottom up language]
- Previous by thread: Re: LOOP blows!
- Next by thread: Re: LOOP blows!
- Index(es):