Created
February 12, 2019 00:51
-
-
Save briochemc/db7faf3f116477091f02e31261e76350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f1(x) = x | |
f2(x) = 2x | |
f3(x) = 3x | |
list_methods = [ | |
("method1", :f1) | |
("method2", :f2) | |
("method3", :f3) | |
] | |
aDict = Dict() | |
for (method_name, f) in list_methods | |
local x, baz | |
x = 42 | |
baz = :( foo = $f($x) ) | |
eval(baz) | |
aDict[method_name] = foo | |
end | |
aDict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment