[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: expression to the left of `:'?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 10 Apr 2000 14:23:00 -0300
> m3 = (m1 * m2):invert()
This is the price we pay for having the semicolon optional after a
statement. The ':' denotes a call, and can be used as a statement by
itself. Therefore, if the previous expression were correct, the following
one should be, too:
(m1*m2):print()
But now, if the previous statement was "i=a", we would have
i=a
(m1*m2):print()
and the interpreter would read this as "i=a(m1*m2):print()" (as it
actually does). I do not know any "elegant" solution to this problem.
-- Roberto