Send an unknown method call: Difference between revisions

added smalltalk
(Added PicoLisp)
(added smalltalk)
Line 122:
e.public_send :privacy # raises NoMethodError
e.send :privacy # => "secret"</lang>
 
=={{header|Smalltalk}}==
<lang smalltalk>Object subclass: #Example.
 
Example extend [
foo: x [
^ 42 + x ] ].
 
name := 'foo:' asSymbol.
 
Example new perform: name with: 5. " returns 47 "</lang>
 
The <code>perform:with:with:</code> family of methods exist for methods with 0 - 2 (3 in GNU Smalltalk) arguments. For methods with more arguments, use <code>perform:withArguments:</code>, which takes an array of arguments.
 
=={{header|Tcl}}==
Anonymous user