Respond to an unknown method call: Difference between revisions

Added zkl
(Added zkl)
Line 1,039:
bash: foo: command not found
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}}
Anonymous user