Respond to an unknown method call: Difference between revisions
Respond to an unknown method call (view source)
Revision as of 12:10, 2 February 2024
, 3 months ago→{{header|Wren}}: Changed to Wren S/H
(→{{header|Object Pascal}}: complete replacement of the example) |
m (→{{header|Wren}}: Changed to Wren S/H) |
||
Line 1,656:
=={{header|Wren}}==
Unlike some other dynamically typed languages, it is not possible to create new methods at runtime in Wren. Attempting to call an unknown method would therefore normally result in a fatal error. However, we can catch such an error and redirect it for user interaction as shown below.
<syntaxhighlight lang="
class Test {
|