Audits Hackathons Blockgeeks About

Learn Rholang: Join Operator


#1

Multiple Data Sources

Occasionally a computation can only be made once data is retrieved (messages are received) from two or more different data sources. For example, you can’t tell whether you won the lottery until you’ve got your ticket number and the winning number. You can’t make change for a purchase until you know the price and the amount tendered. You can’t tell who wins a pushup contest until you know mow many pushups each competitor completed.

Rholang has the join operator for exactly this situation. To perform a join, just use the

; ‘character’.
For (p1Pushups <- @“player1”; p2Pushups <- @“player2”) { @“stdout”!(“The winner is…”) }