lua-users home
lua-l archive

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


hello,

I want to have an "object" that intercept unknown "methods" call, calling a
known error handler. 

for ex: TObject:unkMethod() calls TObject:DoesNotUnderstand

I tried this (see below) but I get an error on the last line.
how can I do that ?

TIA,
Pierre.
------------------------------------------

Object=newtag()
TObject = {}
settag( TObject, Object )
function TObject:DoesNotUnderstand ( ... )
  print('DoesNotUnderstand')
end
settagmethod( Object, "function", TObject:DoesNotUnderstand )