27 lines
546 B
Plaintext
27 lines
546 B
Plaintext
;; A dyn class instance in a .fln program, for code evaluated from its buffer:
|
|
;; eval-expr reads the request's syntax, at a stop as well as at a park.
|
|
import agent "vendor:agent"
|
|
|
|
defclass(State, [paused bool step bool])
|
|
|
|
once state = State(false, false)
|
|
once go = false
|
|
|
|
struct Missing(id: i32)
|
|
|
|
fn boom() -> i64
|
|
restart-case
|
|
error(Missing{.id 1})
|
|
0
|
|
restart carry-on()
|
|
-1
|
|
|
|
fn main() -> i32
|
|
agent/start("/tmp/flan-dev-fln-dyn-fallback.sock")
|
|
for i in range(4000)
|
|
agent/wait(5)
|
|
if go
|
|
go = false
|
|
boom()
|
|
0
|