JoshOrndorff / LearnRholangByExample

Teaches rholang to beginners and intermediate programmers through hands-on examples and experimentation.
67 stars 32 forks source link

Proper solution to the patience game #43

Open JoshOrndorff opened 5 years ago

JoshOrndorff commented 5 years ago

dckc showed how to encode select. This will solve the patience game that I couldn't figure out when writing the tutorial.

new once in {
  once!(Nil) |
  for(pat1 <- n1; _ <- once) { p1 } |
  for(pat2 <- n2; _ <- once) { p2 }
}