Actors with Multi-Headed Receive Clauses, статья.
Here's a simple example of a market-place actorhttp://hackage.haskell.org/cgi-bin/hackage-scripts/package/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 toreceive Seller x, Buyer y when x == y -> "match found"
Чем это дело интересно? ( Collapse )