[erlang-questions] Curiosity on Abstract Format for try_catch clauses

Paul Davis paul.joseph.davis@REDACTED
Mon Jun 5 23:28:49 CEST 2017


Howdy,

I've been working on a tool using erl_scan, erl_parse, and friends
lately and stumbled over an oddity in the Abstract Format for
try_catch clauses:

https://github.com/erlang/otp/blob/OTP-19.3.5/lib/stdlib/src/erl_parse.yrl#L456-L464

For some reason there's a {var, Anno, '_'} expression inserted in the
Patterns for each try_catch clause and it left me scratching my head
what it was doing there. I haven't read enough to what happens
afterwords but my only guess is that there's something internally that
gets matched with the ignore pattern. Given that its ignored I figured
its probably historical but thought it curious enough to ask if anyone
had some insight on that.

I did try and look through the history but that bit of Abstract Format
is nearly unchanged since the first commit of R13B03 in the public
repository:

https://github.com/erlang/otp/blob/84adefa331c4159d432d22840663c38f155cd4c1/lib/stdlib/src/erl_parse.yrl#L415-L423

Thanks,
Paul



More information about the erlang-questions mailing list