lua-users home
lua-l archive

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


Hi!

I played around trying to create a small DSL and stumbled upon an unexpected behaviour. This is a small example:

local function f()
    return setmetatable( {}, {
        __div = function( t, arg )
            print( arg )
        end } )
end

f{} / 'a'

I get the error message "unexpected symbol near '/'".

Surprisingly, the following prints 'a':

(function() end)( f{} / 'a' )

Regards,
Matthias