Skip to content
Snippets Groups Projects
Commit 5cd8e705 authored by Daniel Olsson's avatar Daniel Olsson
Browse files

Try commit

parent 9aff870b
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,20 @@ in the blanks, but most parts of the code are very similar."""
for (name,op) in [(:add, :+), (:sub, :-), (:mul, :*)]
# Create a function that is named for example add and returns the
# sum of its two arguments
#name = eval(Expr(:call, op, 1, 1))
function temp(x,y)
return eval(Expr(:call,op,x,y))
end
print(name)
name = temp
println(" for 1 and 1")
println(name(1,1))
end
@assert 3 == add(1, 2)
@assert -1.0 == sub(1.0, 2.0)
@assert "abc" == mul("ab", "c")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment