Respond to an unknown method call: Difference between revisions

Content added Content deleted
(Add Brat solution)
Line 3: Line 3:


This task is intended only for object systems that use a dynamic dispatch mechanism without static checking.
This task is intended only for object systems that use a dynamic dispatch mechanism without static checking.

=={{header|Brat}}==
<lang brat>example = object.new

example.no_method = { meth_name, *args |
p "#{meth_name} was called with these arguments: #{args}"
}

example.this_does_not_exist "at all" #Prints "this_does_not_exist was called with these arguments: [at all]"</lang>

=={{header|C sharp|C#}}==
=={{header|C sharp|C#}}==
{{works with|C sharp|4.0}}
{{works with|C sharp|4.0}}