2

I am trying to establish a group of anonymous functions to later call and receive a value from.

Here is a basic working example of the problem I'm facing.

expr = :(x+y)
f = eval((x,y,z)->expr)

This gives me the following response... enter image description here

Then when I try to call it to be evaluated I just get the expression back.

f(1,2,3)

enter image description here

I would expect it to return 3 but instead it returns the original expression. How do I get it to evaluate the expression inside the anonymous function as it has been constructed here?

Thanks

Sean C
  • 165
  • 6

0 Answers0