lua-users home
lua-l archive

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


On Wed, Mar 01, 2006 at 02:23:54AM +0000, David Manura wrote:
>   f = function print("hello") end  -- expression form
>   function f print("hello") end    -- statement form

What does this mean:

function print(x) print(y) end

With your suggestion, we can't tell unless we know whether it's in an
expression or statement context. This makes code less readable and
error reporting less accurate. Not a good deal to save the occasional
pair of parentheses.

>   f 123

So what does 'f -123' mean?

>   f x

What does 'print(x) print(y)' mean?

print(x); print(y)?
print(x)(print)(y)?
print(x)(print(y))?

Not good...

-- Jamie Webb