lua-users home
lua-l archive

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


If I place a hook on "index" for strings like this:

function gettableHook(object, field)
  print("called gettableHook")
end

settagmethod( tag(""), "gettable", gettableHook)

and then do:

  a = "foo"
  a.test

The gettableHook is called properly.

But if I do:

  "foo".test

I get a syntax error. 
Is there any way to get both to work the same?

Steve