receive semantics

26 views
Skip to first unread message

Martin Vejmelka

unread,
Jan 30, 2014, 10:07:28 PM1/30/14
to jo...@googlegroups.com
Hi,

I see a difference in semantics of the receive form and erlang receive.  In erlang, a message not matching any patterns in a receive simply sits in the mailbox and receive keeps waiting until it matches.  In joxa, sending a message that does not match any pattern in a receive results in a case_clause exception.

Compiling a simple test case from erlang to core erlang and from joxa to core erlang shows that joxa adds an extra case to the receive which matches everything and generates the case_clause.

In erlang the match everything pattern resulting in a case_clause error is only added for 'case' but not for 'receive'.
Joxa adds this for both receive and case, this seems to be due to :case and :receive expressions in joxa-cmp-expr using the same joxa-cmp-case/make-pattern function to generate the cerl-clauses.

Is this intentional?  From https://github.com/erlware/joxa/issues/26 I got the impression that receive was supposed leave non-matching messages in the mailbox but it's an old message.

Thanks,

- Martin
Reply all
Reply to author
Forward
0 new messages