MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Return[] in pure function

I seems to me that there is a bug in the implementation of pure 
functions. If somebody can explain the following behaviour it would be 
interessting. If not, maybe Wolfram can contribute something.
f[x_]:= If[x==0,Return[Error],x];
f /@ {1,0}
gives {1,Error} what is fine.
Now replace the function by a pure function:
If[#==0,Return[Error],#]& /@ {1,0}
this gives {1,Return["Error"]}. The Return statement has not been evaluated.

sincerely, Daniel

  • Prev by Date: Combinatorica functions doc
  • Next by Date: a bad demonstration of Mathematica's MathML capabilities
  • Previous by thread: Re: Combinatorica functions doc
  • Next by thread: Re: Return[] in pure function