catch not an rvalue

Hal Snyder <>
Tue Feb 19 17:21:57 CET 2002

Hope this isn't another RTFM, but I can't resist asking.
Am going through the puzzle box while home with the flu.

During prototyping, it would be nice to replace
  X = <risky expression>
  X = catch <risky expression>
but the shell (and compiler) don't like that.

Just wondering why the syntax error is happening.
Didn't see the answer in, e.g., Chap 6 of 

1>catch 22.
2> X=catch 22.
** 1: syntax error before: 'catch' **


3> F=fun()->catch 22 end.
4> X=F().

More information about the erlang-questions mailing list