Jump to content

Send an unknown method call: Difference between revisions

Add Julia language
m (added a ;Task to the task's preamble.)
(Add Julia language)
Line 292:
name = "foo";
example[name](5) # => 47</lang>
 
=={{header|Julia}}==
{{works with|Julia|0.6}}
 
<lang julia>const functions = Dict{String,Function}(
"foo" => x -> 42 + x,
"bar" => x -> 42 * x)
 
@show functions["foo"](3)
@show functions["bar"](3)</lang>
 
{{out}}
<pre>(functions["foo"])(3) = 45
(functions["bar"])(3) = 126</pre>
 
=={{header|Kotlin}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.