rudus/sandbox.ld

26 lines
455 B
Plaintext
Raw Normal View History

2025-06-28 00:41:29 +00:00
fn foo (val) -> receive {
(:report) -> {
print! ("LUDUS SAYS ==> value is {val}")
2025-06-28 00:41:29 +00:00
foo (val)
}
(:set, x) -> {
print! ("LUDUS SAYS ==> foo! was {val}, now is {x}")
2025-06-28 00:41:29 +00:00
foo (x)
}
(:get, pid) -> {
print! ("LUDUS SAYS ==> value is {val}")
send (pid, (:response, val))
2025-06-28 00:41:29 +00:00
foo (val)
}
2025-06-28 00:41:29 +00:00
}
2025-06-27 00:30:40 +00:00
2025-06-28 00:41:29 +00:00
let fooer = spawn! (fn () -> foo (42))
print! (fooer)
send (fooer, (:set, 23))
yield! ()
2025-06-28 00:41:29 +00:00
send (fooer, (:get, self ()))
yield! ()
2025-06-28 00:41:29 +00:00
flush! ()