entering world loop; active process is axolotl_0
closing over in type at 1: #{:sin fn sin/base, ...
closing over in eq? at 1: #{:sin fn sin/base, ...
closing over in eq? at 2: fn eq?
closing over in first at 1: #{:sin fn sin/base, ...
closing over in rest at 1: #{:sin fn sin/base, ...
closing over in inc at 1: #{:sin fn sin/base, ...
closing over in dec at 1: #{:sin fn sin/base, ...
closing over in count at 1: #{:sin fn sin/base, ...
closing over in any? at 1: fn empty?
closing over in any? at 2: fn not
closing over in list at 1: #{:sin fn sin/base, ...
closing over in append at 1: #{:sin fn sin/base, ...
closing over in fold at 1: fn fold
closing over in fold at 2: fn first
closing over in fold at 3: fn rest
closing over in foldr at 1: fn foldr
closing over in foldr at 2: fn first
closing over in foldr at 3: fn rest
closing over in map at 1: fn map
closing over in map at 2: fn append
closing over in map at 3: fn fold
closing over in filter at 1: fn filter
closing over in filter at 2: fn append
closing over in filter at 3: fn fold
closing over in keep at 1: fn some?
closing over in keep at 2: fn filter
closing over in concat at 1: #{:sin fn sin/base, ...
closing over in concat at 2: fn concat
closing over in concat at 3: fn fold
closing over in contains? at 1: fn first
closing over in contains? at 2: fn eq?
closing over in contains? at 3: fn rest
closing over in unbox at 1: #{:sin fn sin/base, ...
closing over in store! at 1: #{:sin fn sin/base, ...
closing over in update! at 1: fn unbox
closing over in update! at 2: fn store!
closing over in show at 1: #{:sin fn sin/base, ...
closing over in string at 1: fn show
closing over in string at 2: fn string
closing over in string at 3: fn concat
closing over in join at 1: fn join
closing over in join at 2: fn concat
closing over in join at 3: fn fold
closing over in split at 1: #{:sin fn sin/base, ...
closing over in trim at 1: #{:sin fn sin/base, ...
closing over in upcase at 1: #{:sin fn sin/base, ...
closing over in downcase at 1: #{:sin fn sin/base, ...
closing over in chars at 1: #{:sin fn sin/base, ...
closing over in chars/safe at 1: #{:sin fn sin/base, ...
closing over in strip at 1: fn strip
closing over in words at 1: fn strip
closing over in words at 2: fn split
closing over in words at 3: fn empty?
closing over in words at 4: fn append
closing over in words at 5: fn fold
closing over in sentence at 1: fn join
closing over in to_number at 1: #{:sin fn sin/base, ...
closing over in print! at 1: fn string
closing over in print! at 2: fn map
closing over in print! at 3: fn join
closing over in print! at 4: #{:sin fn sin/base, ...
closing over in print! at 5: box { [] }
closing over in print! at 6: fn append
closing over in print! at 7: fn update!
closing over in report! at 1: fn print!
closing over in report! at 2: fn show
closing over in report! at 3: fn concat
closing over in doc! at 1: #{:sin fn sin/base, ...
closing over in doc! at 2: fn print!
closing over in add at 1: #{:sin fn sin/base, ...
closing over in add at 2: fn add
closing over in add at 3: fn fold
closing over in sub at 1: #{:sin fn sin/base, ...
closing over in sub at 2: fn sub
closing over in sub at 3: fn fold
closing over in mult at 1: #{:sin fn sin/base, ...
closing over in mult at 2: fn mult
closing over in mult at 3: fn fold
closing over in div at 1: #{:sin fn sin/base, ...
closing over in div at 2: fn mult
closing over in div at 3: fn fold
closing over in div at 4: fn div
closing over in div/0 at 1: #{:sin fn sin/base, ...
closing over in div/0 at 2: fn mult
closing over in div/0 at 3: fn fold
closing over in div/0 at 4: fn div/0
closing over in div/safe at 1: fn div
closing over in div/safe at 2: fn mult
closing over in div/safe at 3: fn fold
closing over in div/safe at 4: fn div/safe
closing over in inv at 1: fn div
closing over in inv/0 at 1: fn div/0
closing over in inv/safe at 1: fn div/safe
closing over in neg at 1: fn mult
closing over in gt? at 1: #{:sin fn sin/base, ...
closing over in gte? at 1: #{:sin fn sin/base, ...
closing over in lt? at 1: #{:sin fn sin/base, ...
closing over in lte? at 1: #{:sin fn sin/base, ...
closing over in between? at 1: fn gte?
closing over in between? at 2: fn lt?
closing over in neg? at 1: fn lt?
closing over in pos? at 1: fn gt?
closing over in abs at 1: fn neg?
closing over in abs at 2: fn mult
closing over in turn/deg at 1: fn mult
closing over in deg/turn at 1: fn div
closing over in turn/rad at 1: 6.283185307179586
closing over in turn/rad at 2: fn mult
closing over in rad/turn at 1: 6.283185307179586
closing over in rad/turn at 2: fn div
closing over in deg/rad at 1: 6.283185307179586
closing over in deg/rad at 2: fn div
closing over in deg/rad at 3: fn mult
closing over in rad/deg at 1: 6.283185307179586
closing over in rad/deg at 2: fn div
closing over in rad/deg at 3: fn mult
closing over in sin at 1: fn turn/rad
closing over in sin at 2: #{:sin fn sin/base, ...
closing over in sin at 3: fn deg/rad
closing over in cos at 1: fn turn/rad
closing over in cos at 2: #{:sin fn sin/base, ...
closing over in cos at 3: fn deg/rad
closing over in tan at 1: fn turn/rad
closing over in tan at 2: #{:sin fn sin/base, ...
closing over in tan at 3: fn deg/rad
closing over in rotate at 1: fn rotate
closing over in rotate at 2: fn cos
closing over in rotate at 3: fn mult
closing over in rotate at 4: fn sin
closing over in rotate at 5: fn sub
closing over in rotate at 6: fn add
closing over in atan/2 at 1: #{:sin fn sin/base, ...
closing over in atan/2 at 2: fn rad/turn
closing over in atan/2 at 3: fn atan/2
closing over in atan/2 at 4: fn rad/deg
closing over in angle at 1: fn atan/2
closing over in angle at 2: fn sub
closing over in mod at 1: #{:sin fn sin/base, ...
closing over in mod/0 at 1: #{:sin fn sin/base, ...
closing over in mod/safe at 1: #{:sin fn sin/base, ...
closing over in even? at 1: fn mod
closing over in even? at 2: fn eq?
closing over in odd? at 1: fn mod
closing over in odd? at 2: fn eq?
closing over in square at 1: fn mult
closing over in sqrt at 1: fn neg?
closing over in sqrt at 2: fn not
closing over in sqrt at 3: #{:sin fn sin/base, ...
closing over in sqrt/safe at 1: fn neg?
closing over in sqrt/safe at 2: fn not
closing over in sqrt/safe at 3: #{:sin fn sin/base, ...
closing over in sum_of_squares at 1: fn square
closing over in sum_of_squares at 2: fn add
closing over in sum_of_squares at 3: fn sum_of_squares
closing over in sum_of_squares at 4: fn fold
closing over in dist at 1: fn sum_of_squares
closing over in dist at 2: fn sqrt
closing over in dist at 3: fn dist
closing over in heading/vector at 1: fn neg
closing over in heading/vector at 2: fn add
closing over in heading/vector at 3: fn cos
closing over in heading/vector at 4: fn sin
closing over in floor at 1: #{:sin fn sin/base, ...
closing over in ceil at 1: #{:sin fn sin/base, ...
closing over in round at 1: #{:sin fn sin/base, ...
closing over in range at 1: #{:sin fn sin/base, ...
closing over in at at 1: #{:sin fn sin/base, ...
closing over in second at 1: fn ordered?
closing over in second at 2: fn at
closing over in last at 1: fn ordered?
closing over in last at 2: fn count
closing over in last at 3: fn dec
closing over in last at 4: fn at
closing over in slice at 1: fn slice
closing over in slice at 2: fn gte?
closing over in slice at 3: fn count
closing over in slice at 4: fn gt?
closing over in slice at 5: fn neg?
closing over in slice at 6: #{:sin fn sin/base, ...
closing over in butlast at 1: fn count
closing over in butlast at 2: fn dec
closing over in butlast at 3: fn slice
closing over in assoc at 1: #{:sin fn sin/base, ...
closing over in dissoc at 1: #{:sin fn sin/base, ...
closing over in get at 1: fn get
closing over in get at 2: #{:sin fn sin/base, ...
closing over in update at 1: fn get
closing over in update at 2: fn assoc
closing over in keys at 1: fn list
closing over in keys at 2: fn first
closing over in keys at 3: fn map
closing over in values at 1: fn list
closing over in values at 2: fn second
closing over in values at 3: fn map
closing over in has? at 1: fn has?
closing over in has? at 2: fn get
closing over in has? at 3: fn some?
closing over in dict at 1: fn assoc
closing over in dict at 2: fn fold
closing over in dict at 3: fn list
closing over in dict at 4: fn dict
closing over in each! at 1: fn each!
closing over in random at 1: #{:sin fn sin/base, ...
closing over in random at 2: fn random
closing over in random at 3: fn mult
closing over in random at 4: fn sub
closing over in random at 5: fn add
closing over in random at 6: fn count
closing over in random at 7: fn floor
closing over in random at 8: fn at
closing over in random at 9: fn keys
closing over in random at 10: fn get
closing over in random_int at 1: fn random
closing over in random_int at 2: fn floor
closing over in add_command! at 1: box { [] }
closing over in add_command! at 2: fn append
closing over in add_command! at 3: fn update!
closing over in add_command! at 4: box { #{:penwidth 1,...
closing over in add_command! at 5: fn unbox
closing over in add_command! at 6: fn apply_command
closing over in add_command! at 7: fn store!
closing over in forward! at 1: fn add_command!
closing over in back! at 1: fn add_command!
closing over in left! at 1: fn add_command!
closing over in right! at 1: fn add_command!
closing over in penup! at 1: fn add_command!
closing over in pendown! at 1: fn add_command!
closing over in pencolor! at 1: fn add_command!
closing over in penwidth! at 1: fn add_command!
closing over in background! at 1: fn add_command!
closing over in home! at 1: fn add_command!
closing over in clear! at 1: fn add_command!
closing over in goto! at 1: fn add_command!
closing over in goto! at 2: fn goto!
closing over in setheading! at 1: fn add_command!
closing over in showturtle! at 1: fn add_command!
closing over in hideturtle! at 1: fn add_command!
closing over in loadstate! at 1: fn add_command!
closing over in apply_command at 1: fn assoc
closing over in apply_command at 2: fn add
closing over in apply_command at 3: fn update
closing over in apply_command at 4: fn sub
closing over in apply_command at 5: fn heading/vector
closing over in apply_command at 6: fn mult
closing over in position at 1: box { #{:penwidth 1,...
closing over in position at 2: fn unbox
closing over in heading at 1: box { #{:penwidth 1,...
closing over in heading at 2: fn unbox
closing over in pendown? at 1: box { #{:penwidth 1,...
closing over in pendown? at 2: fn unbox
closing over in pencolor at 1: box { #{:penwidth 1,...
closing over in pencolor at 2: fn unbox
closing over in penwidth at 1: box { #{:penwidth 1,...
closing over in penwidth at 2: fn unbox
closing over in self at 1: #{:sin fn sin/base, ...
closing over in send at 1: #{:sin fn sin/base, ...
closing over in spawn! at 1: #{:sin fn sin/base, ...
closing over in yield! at 1: #{:sin fn sin/base, ...
closing over in alive? at 1: #{:sin fn sin/base, ...
closing over in link! at 1: fn link!
closing over in link! at 2: #{:sin fn sin/base, ...
closing over in msgs at 1: #{:sin fn sin/base, ...
closing over in flush! at 1: #{:sin fn sin/base, ...
closing over in flush_i! at 1: #{:sin fn sin/base, ...
closing over in sleep! at 1: #{:sin fn sin/base, ...
yielded from axolotl_0
***match clause: : (:set, x)
binding `x` in sandbox
stack depth: 3; match depth: 0
at stack index: 2
new locals: x@2//1
resolving binding `x` in sandbox
locals: x@2//1
at locals position 2
leaving scope 1
releasing binding x@2//1
leaving scope 0
***leaving block before pop stack depth: 1
popping back from 1 to 0
=== source code ===
&  fn receive (receiver) -> {
&   fn looper {
&    ([], _) -> yield! ()
&    (xs, i) -> {
&     print!("looping through messages:", xs)
&     match receiver (first (xs), i) with {
&      :does_not_understand -> looper (rest (xs), inc (i))
&      x -> x
&    }}
&  }
&  print! ("receiving in", self (), "with messages", msgs())
&  looper (msgs (), 0)
& }

& fn agent (x) -> receive (fn (msg, i) -> {
& print!("received msg in agent: ", msg)
& match msg with {
&   (:get, pid) -> {
&     flush_i! (i)
&     print!("getted from {pid}")
&     send (pid, (:response, x))
&     agent (x)
&   }
&   (:set, y) -> {flush_i!(i); print!("setted! {y}"); agent (y)}
&   (:update, f) -> {flush_i!(i);print!("updated: {f}"); agent (f (x))}
&   y -> {print!("no agent reception match!!!! {y}");:does_not_understand}
& }
& })

& fn agent/get (pid) -> {
&   send (pid, (:get, self ()))
&   yield! ()
&   receive (fn (msg, i) -> match msg with {
&     (:response, x) -> {flush_i! (i); x}
&   })
& }

& fn agent/set (pid, val) -> send (pid, (:set, val))

& fn agent/update (pid, f) -> send (pid, (:update, f))

& let counter = spawn! (fn () -> agent (0))
& agent/set (counter, 12)

match (:set, 12) with {
  (:set, x) -> x
}

=== chunk: sandbox ===
IDX | CODE           | INFO
0000: constant         00000: :set
0003: constant         00001: 12
0006: push_tuple       002
0008: ***match clause: : (:set, x)
0010: match_tuple      002
0012: jump_if_no_match 00028
0015: load_tuple
0016: match_depth      001
0018: match_constant   00000: :set
0021: jump_if_no_match 00017
0024: match_depth      000
0026: match
0027: binding `x` in sandbox
0029: stack depth: 3; match depth: 0
0031: at stack index: 2
0033: new locals: x@2//1
0035: jump_if_no_match 00003
0038: jump             00002
0041: pop_n            002
0043: jump_if_no_match 00016
0046: resolving binding `x` in sandbox
locals: x@2//1
0048: at locals position 2
0050: push_binding     002
0052: store
0053: leaving scope 1
0055: releasing binding x@2//1
0057: pop_n            002
0059: jump             00001
0062: panic_no_match
0063: load
0064: store
0065: leaving scope 0
0067: ***leaving block before pop stack depth: 1
0069: popping back from 1 to 0
0071: pop
0072: load



=== vm run ===
entering world loop; active process is cormorant_0
0000: [] (_,_,_,_,_,_,_,_) cormorant_0 {}
0000: constant         00000: :set
0003: [->:set<-] (_,_,_,_,_,_,_,_) cormorant_0 {}
0003: constant         00001: 12
0006: [->:set<-|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0006: push_tuple       002
0008: [->(:set, 12)<-] (_,_,_,_,_,_,_,_) cormorant_0 {}
0008: ***match clause: : (:set, x)
0010: [->(:set, 12)<-] (_,_,_,_,_,_,_,_) cormorant_0 {}
0010: match_tuple      002
0012: [->(:set, 12)<-] (_,_,_,_,_,_,_,_) cormorant_0 {}
0012: jump_if_no_match 00028
0015: [->(:set, 12)<-] (_,_,_,_,_,_,_,_) cormorant_0 {}
0015: load_tuple
0016: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0016: match_depth      001
0018: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0018: match_constant   00000: :set
0021: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0021: jump_if_no_match 00017
0024: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0024: match_depth      000
0026: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0026: match
0027: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0027: binding `x` in sandbox
0029: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0029: stack depth: 3; match depth: 0
0031: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0031: at stack index: 2
0033: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0033: new locals: x@2//1
0035: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0035: jump_if_no_match 00003
0038: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0038: jump             00002
0043: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0043: jump_if_no_match 00016
0046: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0046: resolving binding `x` in sandbox
locals: x@2//1
0048: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0048: at locals position 2
0050: [->(:set, 12)<-|:set|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0050: push_binding     002
0052: [->(:set, 12)<-|:set|12|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0052: store
0053: [->(:set, 12)<-|:set|12] (12,_,_,_,_,_,_,_) cormorant_0 {}
0053: leaving scope 1
0055: [->(:set, 12)<-|:set|12] (12,_,_,_,_,_,_,_) cormorant_0 {}
0055: releasing binding x@2//1
0057: [->(:set, 12)<-|:set|12] (12,_,_,_,_,_,_,_) cormorant_0 {}
0057: pop_n            002
0059: [->(:set, 12)<-] (12,_,_,_,_,_,_,_) cormorant_0 {}
0059: jump             00001
0063: [->(:set, 12)<-] (12,_,_,_,_,_,_,_) cormorant_0 {}
0063: load
0064: [->(:set, 12)<-|12] (_,_,_,_,_,_,_,_) cormorant_0 {}
0064: store
0065: [->(:set, 12)<-] (12,_,_,_,_,_,_,_) cormorant_0 {}
0065: leaving scope 0
0067: [->(:set, 12)<-] (12,_,_,_,_,_,_,_) cormorant_0 {}
0067: ***leaving block before pop stack depth: 1
0069: [->(:set, 12)<-] (12,_,_,_,_,_,_,_) cormorant_0 {}
0069: popping back from 1 to 0
0071: [->(:set, 12)<-] (12,_,_,_,_,_,_,_) cormorant_0 {}
0071: pop
0072: [] (12,_,_,_,_,_,_,_) cormorant_0 {}
0072: load
yielded from cormorant_0
{"result":"12","io":{"stdout":{"proto":["text-stream","0.1.0"],"data":""},"turtle":{"proto":["turtle-graphics","0.1.0"],"data":[]}}}
