Respond to an unknown method call: Difference between revisions

Line 1,258:
=={{header|Ring}}==
<lang ring>
result(f1isFunction(:func1),":func1")
f1 = isfunction("func1")
result(f2isFunction(:func2),":func2")
f2 = isfunction("func2")
result(f1,"func1")
result(f2,"func2")
 
func func1
see? "methodMessage exists"from +function: nlfunc1"
 
func result(res lExist,met)cFuncName
if res lExist
see? "methodFunction " + metcFuncName + " exists" + nl
eval(metcall + "cFuncName()") + nl
else
see? "methodFunction " + metcFuncName + " does not exist" + nl
ok
</lang>
{{out}}
<pre>
methodFunction func1 exists
Message from function: func1
method exists
methodFunction func2 does not exist
</pre>
 
2,468

edits