Respond to an unknown method call: Difference between revisions

Content added Content deleted
(→‎{{header|Lasso}}: Adding Lasso unknown method handler)
m (→‎{{header|Lasso}}: clean up some formatting)
Line 425:
public _unknownTag(...) => {
local(n = method_name->asString)
return 'tried to handle unknown method called "'+#n+'"'+(#rest->size ? ' with args: "'+#rest->join(',')+'"')+'\r'
(#rest->size ? ' with args: "'+#rest->join(',')+'"')+'\r'
}
}
Line 431 ⟶ 432:
local(e = exampletype)
#e->foo() // outputs 'this is foo'
#e->bar() // outputs 'this is barfoo'
 
#e->stuff() // outputs 'tried to handle unknown method called "stuff"'
#e->bar()
#e->dothis('here',12,'there','nowhere') // outputs 'tried to handle unknown method called "dothis" with args: "here,12,there,nowhere"'</lang>
// outputs 'this is bar'
 
#e->stuff()
#e->stuff() // outputs 'tried to handle unknown method called "stuff"'
 
#e->dothis('here',12,'there','nowhere')
#e->dothis('here',12,'there','nowhere') // outputs 'tried to handle unknown method called "dothis" with args: "here,12,there,nowhere"'</lang>
 
=={{header|Logtalk}}==