lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Oscar Lazzarino <osk@cclinf.polito.it> wrote:
> I don't really agree. You just have to use some self-discipline. And if
> you don't like the costruct, you're not forced to use it... But you
> can't deny that 
> 
>  while ( X = read() )
>  do
>   print ( X )
>  end
> 
> is by far nicer and CLEARER than
> 
>  X = read()
>  while X
>  do
>   print ( X )
>   X = read()
>  end

I would dispute "clearer".  I prefer the following construct to both
of the above (though I often use the first one in C).

while 1 do
	X = read()
	if not X then break end
	print ( X )
end	

> I would really like to see this FEATURE added to 4.1. Why don't we start
> a poll?

My vote would be no.  I agree with the person who views Lua a bit
like Scheme, except my conclusion is the exact opposite (since
assignments return no meaningful value in Scheme).  Remember also
that Lua is designed to cater for non-programmers, who are very
likely to type `=' instead of `=='.

-- 
tjaden@psynet.net - http://www.psynet.net/tjaden/
ELBONICS (el BON iks), n.  The actions of two people maneuvering for one
arm rest in a movie theater.  -- Rich Hall, "Sniglets"