![]() |
От: |
thesz
|
http://thesz.livejournal.com |
Дата: | 05.06.09 15:39 | ||
Оценка: |
Here's a simple example of a market-place actor
receive Seller x, Buyer x -> "match found"
We employ the combination of multiple messages in a receive pattern and non-linear patterns to test for a matching seller and a buyer. Non-linear patterns are in fact a short-hand for guards. That is, the above is equivalent to
receive Seller x, Buyer y when x == y -> "match found"