I have the following Expression:

```
ex = :(sum(x[i] for i=1:4)- y[1] * y[2] + z)
```

which I would like to evaluate over some data x, y, z. I have tried doing direct substitution through symbolic manipulations, but it is abysmally slow (~0.2s per set of substitutions).

It seems the right approach is to turn it into a function as here, but the application of that is somewhat limited.

Is there a method for converting `ex`

into a function like the following?

```
f(x,y,z) = sum(x[i] for i=1:4)- y[1] * y[2] + z
```

Thanks in advance!