Send an unknown method call: Difference between revisions

Content added Content deleted
m (added a ;Task to the task's preamble.)
(Add Julia language)
Line 292: Line 292:
name = "foo";
name = "foo";
example[name](5) # => 47</lang>
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}}==
=={{header|Kotlin}}==