[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Inline Functions
- From: "Peter Hill" <corwin@...>
- Date: Fri, 27 Dec 2002 00:47:45 -0000
Peter Hill wrote:
> As far as homogenising changes go, I'd move all atomic items (not just
> "function") out of "exp" and into "prefixexp" where they belong.
> I did a quick test, and the change seems trivial.
> Modified Lua seems to be able to run in my application, and now
> print(3(3)) is an "attempt to call a number value" error instead of syntax
> Saying this does not mean that I like or recommend this change ;-) (I am
> now actually reverting back to the original code in my application)
I personally find "3(3)" to be a rather odd beast myself. However, in Lua4
(with its tag methods) one could redefine the "function" tag method of
numbers to have some desired meaning. So:
would actually be executable code, while:
remained illegal. Totally inconsitent.
In Lua5 with its metatables the nature of things seems to have changed, so
I'm not sure what is now most natural way. Regardless, one *should* be able
function(a) return a end (123)