Jump to content

Respond to an unknown method call: Difference between revisions

m (→‎{{header|Tcl}}: corrected requirements)
Line 161:
example.ding("dong"); // alerts "tried to handle unknown method ding"
// alerts "it had arguments: dong</lang>
 
=={{header|Lua}}==
<lang Lua>
local object={print=print}
setmetatable(object,{__index=function(t,k)return function() print("You called the method",k)end end})
object.print("Hi") -->Hi
object.hello() -->You called the method hello
</lang>
 
=={{header|Objective-C}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.