[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Assignment in functional conditionals, any alternative?
- From: "Wim Couwenberg" <w.couwenberg@...>
- Date: Tue, 6 May 2003 21:15:07 +0200
RLake@oxfam.org.uk wrote:
> It certainly works for your first example, with a while statement
> (with limited scope):
>
> (*) while x := foo() do print(x) end (to use Mark's syntax)
>
> is simply
>
> for x in foo do print(x) end
This is not entirely true on at least two accounts:
1) foo will be called with 2 arguments instead of none.
2) the for loop will _not_ stop for x==false, but only for x==nil.
Bye,
Wim