Skip to content
Prev 317352 / 398506 Next

Help with functions as arguments

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/02/13 08:30, Ian Renner wrote:
Obviously easiest:

X <- 3
f2(X=x, Z=f1(X))

Your solution does not work, as the f1(x) is evaluated and the value is passed on to f1, and your
x is an argument and *only in the function f2* available (= in this context *no* assignment).

I remember something similar, and the solution had to do with eval() and quote() and friends -
i.e. you have to only evaluate f(x) *inside* the function f2 - but unfortunately I do not remember
details.

Cheers,

Rainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRGf97AAoJENvXNx4PUvmCn0EIALjKZK4XsBkELCKJtWU7AXPd
7Qs5Sk2gQF64Jc1uHYm17hwgonZIFIj9IHE05lRP4dl2F6onMACfIEpzz+GF9cO5
qS2Kq3Oe/+bglBZIJ1oBGSxs2YEh5gGIykP+PZcWr4xP8QPQ23wnnTbafxTa7PaU
BkkNrmNBbre5f+wYBbFaxSlSdlslDFg9c6b5OgLzwBLB0o9tr7KA6POCa8HrX7H4
UBsPfwSEkOfyIEwq5drKjXF853nUNRVtd0cPA+mpo+5y/qIkGTiehMRlEGwcBBg7
6uNA8wpTuJI49tdY7rkVEIEGH34atwvBA1kwFYh1UfBzzIg+oRikHm1ZJ4UeJCM=
=h9ju
-----END PGP SIGNATURE-----