Send an unknown method call: Difference between revisions
Content added Content deleted
(Add Common Lisp) |
(→{{header|Lasso}}: Adding Lasso example) |
||
Line 166: | Line 166: | ||
name = "foo"; |
name = "foo"; |
||
example[name](5) # => 47</lang> |
example[name](5) # => 47</lang> |
||
=={{header|Lasso}}== |
|||
<lang Lasso>define mytype => type { |
|||
public foo() => { |
|||
return 'foo was called' |
|||
} |
|||
public bar() => { |
|||
return 'this time is was bar' |
|||
} |
|||
} |
|||
local(obj = mytype, methodname = tag('foo'), methodname2 = tag('bar')) |
|||
#obj->\#methodname->invoke |
|||
#obj->\#methodname2->invoke</lang> |
|||
{{out}} |
|||
<pre>foo was called |
|||
this time is was bar</pre> |
|||
=={{header|Logtalk}}== |
=={{header|Logtalk}}== |