[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Coroutine support in 4.1 / IPC mechanisms
- From: Edgar Toernig <froese@...>
- Date: Fri, 20 Apr 2001 03:41:11 +0200
Luiz Henrique de Figueiredo wrote:
> >> (a)=3; (print or write)(9)
> >How is that going to work? Will the ; be required in Lua 4.1?
> Yes, in this case the ';' will be required to remove the ambiguity.
> I'm glad that ';' will now be useful (but not always required)!
Hmm... up to now the ';' was really optional. Now it makes a
difference. If all cases where it is required would generate a
syntax error it would be ok. But there are cases where both
interpretations are valid (i.e. a=b ; (print)(9) ) and IMHO
that's not good. It makes the language more fragile and complicated.
Maybe a standard identity function  (part of the baselib) would
> > [ (a)=3 ]
> These will be valid in 4.1.
IMHO to let ()-expressions be l-values gives nothing new to the
language and just shows more limitations:
(a) = 1 -- ok
(b) = 1 -- ok
(a and b) = 1 -- invalid
(f()) = 1 -- invalid
Saying: '()' always generates a single value is IMHO cleaner.
 I was even about to remove it from Sol completely. But
remembering my first steps with Lua I kept it :-)
 function id(x) return x end