blocks and modules



Try

foo(y):=block([x:?gensym()],find_root(exp(x)+x=y,x,0,1));

The "Module" feature is Mathematica is actually hazardous since you can, 
in fact,
access the "local" names it generates, globally. Just type them in.

Often people just use names that they think will not be used by others, e.g.

foo(y):=block([xxx], ....)   but that is not entirely safe.