[erlang-questions] try catch params in Core Erlang

Vladimir Gordeev gordeev.vladimir.v@REDACTED
Thu Oct 15 19:57:54 CEST 2015


If you compile some try-catch statements into Core Erlang, you may notice,
that it receives three params in exception pattern:
http://tryerl.seriyps.ru/#id=3bf3

this:

    try foo:bar()
    catch
        some:thing -> ok
    end.

into this:

try
   call 'foo':'bar'
()
of <_cor0> ->
   _cor0
catch <_cor3,_cor2,_cor1> ->
   case <_cor3,_cor2,_cor1> of
     %% Line 7
     <'some','thing',_cor4> when 'true' ->
 'ok'
     ( <_cor3,_cor2,_cor1> when 'true' ->
   primop 'raise'
(_cor1, _cor2)
-| ['compiler_generated'] )
   end

In "An introduction to Core Erlang" catch described as taking two params:
http://www.erlang.org/workshop/carlsson.ps

Question is: what is this third param (_cor4) for?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151015/5244681a/attachment.htm>


More information about the erlang-questions mailing list