rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/tulip

14 lines
253 B
Plaintext
Raw Normal View History

2019-10-21 08:18:17 +00:00
@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
]