Respond to an unknown method call: Difference between revisions
Respond to an unknown method call (view source)
Revision as of 15:08, 10 December 2017
, 6 years ago→{{header|ooRexx}}: corrected code
m (→{{header|Kotlin}}: Corrected capitalization of Firefox) |
Walterpachl (talk | contribs) (→{{header|ooRexx}}: corrected code) |
||
Line 822:
=={{header|ooRexx}}==
To respond to unknown method calls, classes can implement an <code>unknown</code> method. This method is passed the name of the method and an array of the arguments that were used on the call.
<lang ooRexx>u = .unknown~new
u~foo(1, 2, 3)
Line 829 ⟶ 828:
::method unknown
use arg name, args
say "Unknown method" name "invoked with arguments:" args~tostring('l',
Output:
<pre>Unknown method FOO invoked with arguments: 1, 2, 3</pre>▼
▲Unknown method FOO invoked with arguments: 1, 2, 3
=={{header|Oz}}==
|