Respond to an unknown method call: Difference between revisions
Content added Content deleted
(→{{header|AutoHotkey}}: update) |
(Added zkl) |
||
Line 1,039: | Line 1,039: | ||
bash: foo: command not found |
bash: foo: command not found |
||
you tried to call foo |
you tried to call foo |
||
=={{header|zkl}}== |
|||
If something can not be resolved (in a class) the function __notFound is called. It can redirect to another object. |
|||
<lang zkl>class C{ fcn __notFound(name){println(name," not in ",self); bar} |
|||
fcn bar{vm.arglist.println("***")} |
|||
}</lang> |
|||
<pre> |
|||
C.foo //-->"foo not in Class(C)", returns Fcn(bar) |
|||
C.foo(1,2,3) //-->"foo not in Class(C)", "L(1,2,3)***" |
|||
</pre> |
|||
{{omit from|Ada}} |
{{omit from|Ada}} |