rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/tulip
2019-10-21 10:18:17 +02:00

14 lines
253 B
Plaintext

@module ref
ref value = Ref (spawn [ ! => loop value ])
loop value = receive [
.set new-value => loop new-value
p, id, .get => { send p (id, value); loop value }
]
@object Ref pid [
set val = .set val > send pid
get! = .get > send-wait pid
]