[erlang-questions] erl_syntax[_lib] error handling

Richard Carlsson carlsson.richard@REDACTED
Sat Apr 19 13:57:09 CEST 2014


On 2014-04-19 13:51 , Anthony Ramine wrote:
> I think the defensive programming in syntax_tools should be removed entirely.

You might have misunderstood - my point was that there isn't any 
defensive programming in there. Hence, if you feed it invalid input, you 
can't be sure what the resulting exception will be, if any.

> How revert/1 manages to sometimes return custom nodes as is but sometimes crash and sometimes return the actual reverted node drives me insane.

That's a different issue. When I originally wrote erl_syntax, it seemed 
best to pass through anything that couldn't be handled, since the format 
was more or less undocumented in those days. That could probably be 
changed now.

     /Richard




More information about the erlang-questions mailing list