Anonymous user
Send an unknown method call: Difference between revisions
→{{header|J}}: complete thought
(+J) |
(→{{header|J}}: complete thought) |
||
Line 158:
=={{header|J}}==
'''Solution''': There are multiple ways to evoke code at runtime. The most common is '''<tt>". y</tt>''' (''eval''uate the code in the string y, producing a noun), but there's also <tt>
There are other methods as well, e.g., '''<tt>@.</tt>''','''<tt>`:</tt>''', and '''<tt>^:</tt>''', though these are designed to consume gerunds (pre-parsed ASTs) rather than strings (though, of course, a pre-processor can always be provided to convert strings into ASTs before feeding them to these operators).
'''Example''':<lang j> sum =: +/
Line 181 ⟶ 183:
nameToDispatch (128!:2) 1 2 3
3</lang>
=={{header|Java}}==
|