Hi,
I have recently asked on the ml about blocks and modules.
I have received from Richard Fateman the suggestion to use gensym(), as in
foo(y):=block([x:?gensym()],find_root(exp(x)+x=y,x,0,1));
[now that gensym is a first class citizen, the "?" can be omitted too!]
Unfortunately, I am now experiencing problems when trying to compile the
above:
foo(y):=block([x:?gensym()],mode_declare(x,float),find_root(exp(x)+x=y,x,0,1));
compile(foo)
This complains about the fact that x (declared as float) is assigned the
gensym stuff (of type any).
What is the best way to fix this issue?
Would the compilation be fine with the scoping construct (blex)
suggested by Robert Dodier?
Thanks in advance,
Sergio