rudus/sandbox_run.txt
2025-06-24 21:15:46 -04:00

710 lines
20 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

closing over in type at 1: #{:tan fn tan/base, ...
closing over in eq? at 1: #{:tan fn tan/base, ...
closing over in eq? at 2: fn eq?
closing over in first at 1: #{:tan fn tan/base, ...
closing over in rest at 1: #{:tan fn tan/base, ...
closing over in inc at 1: #{:tan fn tan/base, ...
closing over in dec at 1: #{:tan fn tan/base, ...
closing over in count at 1: #{:tan fn tan/base, ...
closing over in any? at 1: fn empty?
closing over in any? at 2: fn not
closing over in list at 1: #{:tan fn tan/base, ...
closing over in append at 1: #{:tan fn tan/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: #{:tan fn tan/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 print! at 1: #{:tan fn tan/base, ...
closing over in show at 1: #{:tan fn tan/base, ...
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: #{:tan fn tan/base, ...
closing over in doc! at 2: fn print!
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: #{:tan fn tan/base, ...
closing over in trim at 1: #{:tan fn tan/base, ...
closing over in upcase at 1: #{:tan fn tan/base, ...
closing over in downcase at 1: #{:tan fn tan/base, ...
closing over in chars at 1: #{:tan fn tan/base, ...
closing over in chars/safe at 1: #{:tan fn tan/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: #{:tan fn tan/base, ...
closing over in unbox at 1: #{:tan fn tan/base, ...
closing over in store! at 1: #{:tan fn tan/base, ...
closing over in update! at 1: fn unbox
closing over in update! at 2: fn store!
closing over in add at 1: #{:tan fn tan/base, ...
closing over in add at 2: fn add
closing over in add at 3: fn fold
closing over in sub at 1: #{:tan fn tan/base, ...
closing over in sub at 2: fn sub
closing over in sub at 3: fn fold
closing over in mult at 1: #{:tan fn tan/base, ...
closing over in mult at 2: fn mult
closing over in mult at 3: fn fold
closing over in div at 1: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/base, ...
closing over in gte? at 1: #{:tan fn tan/base, ...
closing over in lt? at 1: #{:tan fn tan/base, ...
closing over in lte? at 1: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/base, ...
closing over in mod/0 at 1: #{:tan fn tan/base, ...
closing over in mod/safe at 1: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/base, ...
closing over in ceil at 1: #{:tan fn tan/base, ...
closing over in round at 1: #{:tan fn tan/base, ...
closing over in range at 1: #{:tan fn tan/base, ...
closing over in at at 1: #{:tan fn tan/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: #{:tan fn tan/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: #{:tan fn tan/base, ...
closing over in dissoc at 1: #{:tan fn tan/base, ...
closing over in get at 1: fn get
closing over in get at 2: #{:tan fn tan/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: #{:tan fn tan/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 { #{:pencolor :w...
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 { #{:pencolor :w...
closing over in position at 2: fn unbox
closing over in heading at 1: box { #{:pencolor :w...
closing over in heading at 2: fn unbox
closing over in pendown? at 1: box { #{:pencolor :w...
closing over in pendown? at 2: fn unbox
closing over in pencolor at 1: box { #{:pencolor :w...
closing over in pencolor at 2: fn unbox
closing over in penwidth at 1: box { #{:pencolor :w...
closing over in penwidth at 2: fn unbox
binding `hellos!` in sandbox.ld
stack depth: 1; match depth: 0
at stack index: 0
new locals: hellos!@0//0
***function clause matching: : (times)
binding `times` in hellos!
stack depth: 1; match depth: 0
at stack index: 0
new locals: times@0//0
resolving binding `times` in hellos!
locals: times@0//0
at locals position 0
***calling function print! stack depth: 2
resolving binding `print!` in hellos!
locals: times@0//0
as enclosing upvalue 0
***after 1 args stack depth: 4
leaving scope 1
***leaving block before pop stack depth: 2
popping back from 2 to 2
=== function chuncktion: hellos!/1 ===
IDX | CODE | INFO
0000: reset_match
0001: ***function clause matching: : (times)
0003: match_depth 000
0005: match
0006: binding `times` in hellos!
0008: stack depth: 1; match depth: 0
0010: at stack index: 0
0012: new locals: times@0//0
0014: jump_if_no_match 00003
0017: jump 00000
0020: jump_if_no_match 00049
0023: resolving binding `times` in hellos!
locals: times@0//0
0025: at locals position 0
0027: push_binding 000
0029: truncate
0030: jump 00001
0033: decrement
0034: duplicate
0035: jump_if_zero 00027
0038: ***calling function print! stack depth: 2
0040: constant 00000: "hi!"
0043: resolving binding `print!` in hellos!
locals: times@0//0
0045: as enclosing upvalue 0
0047: get_upvalue 000
0049: ***after 1 args stack depth: 4
0051: call 001
0053: store
0054: leaving scope 1
0056: ***leaving block before pop stack depth: 2
0058: popping back from 2 to 2
0060: load
0061: pop
0062: jump_back 00029
0065: pop
0066: constant 00001: nil
0069: store
0070: pop
0071: return
0072: panic_no_match
resolving binding `print!` in sandbox.ld
locals: hellos!@0//0
as global
***calling function hellos! stack depth: 1
resolving binding `hellos!` in sandbox.ld
locals: hellos!@0//0
at locals position 0
***after 1 args stack depth: 3
leaving scope 0
releasing binding hellos!@0//0
***leaving block before pop stack depth: 1
popping back from 1 to 0
=== source code ===
fn hellos! (times) -> repeat times {
print! ("hi!")
}
hellos! (:foo)
=== chunk: sandbox.ld ===
IDX | CODE | INFO
0000: constant 00000: fn hellos!
0003: binding `hellos!` in sandbox.ld
0005: stack depth: 1; match depth: 0
0007: at stack index: 0
0009: new locals: hellos!@0//0
0011: resolving binding `print!` in sandbox.ld
locals: hellos!@0//0
0013: as global
0015: constant 00001: :print!
0018: push_global
0019: set_upvalue
0020: ***calling function hellos! stack depth: 1
0022: constant 00002: :foo
0025: resolving binding `hellos!` in sandbox.ld
locals: hellos!@0//0
0027: at locals position 0
0029: push_binding 000
0031: ***after 1 args stack depth: 3
0033: call 001
0035: store
0036: leaving scope 0
0038: releasing binding hellos!@0//0
0040: ***leaving block before pop stack depth: 1
0042: popping back from 1 to 0
0044: pop
0045: load
=== vm run ===
0000: [] (_,_,_,_,_,_,_,_)
0000: constant 00000: fn hellos!
0003: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0003: binding `hellos!` in sandbox.ld
0005: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0005: stack depth: 1; match depth: 0
0007: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0007: at stack index: 0
0009: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0009: new locals: hellos!@0//0
0011: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0011: resolving binding `print!` in sandbox.ld
locals: hellos!@0//0
0013: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0013: as global
0015: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0015: constant 00001: :print!
0018: [->fn hellos!<-|:print!] (_,_,_,_,_,_,_,_)
0018: push_global
0019: [->fn hellos!<-|fn print!] (_,_,_,_,_,_,_,_)
0019: set_upvalue
closing over in hellos! at 1: fn print!
0020: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0020: ***calling function hellos! stack depth: 1
0022: [->fn hellos!<-] (_,_,_,_,_,_,_,_)
0022: constant 00002: :foo
0025: [->fn hellos!<-|:foo] (_,_,_,_,_,_,_,_)
0025: resolving binding `hellos!` in sandbox.ld
locals: hellos!@0//0
0027: [->fn hellos!<-|:foo] (_,_,_,_,_,_,_,_)
0027: at locals position 0
0029: [->fn hellos!<-|:foo] (_,_,_,_,_,_,_,_)
0029: push_binding 000
0031: [->fn hellos!<-|:foo|fn hellos!] (_,_,_,_,_,_,_,_)
0031: ***after 1 args stack depth: 3
0033: [->fn hellos!<-|:foo|fn hellos!] (_,_,_,_,_,_,_,_)
0033: call 001
=== calling into fn hellos!/1 ===
0000: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0001: ***function clause matching: : (times)
0003: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0003: match_depth 000
0005: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0005: match
0006: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0006: binding `times` in hellos!
0008: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0008: stack depth: 1; match depth: 0
0010: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0010: at stack index: 0
0012: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0012: new locals: times@0//0
0014: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0014: jump_if_no_match 00003
0017: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0017: jump 00000
0020: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0020: jump_if_no_match 00049
0023: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0023: resolving binding `times` in hellos!
locals: times@0//0
0025: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0025: at locals position 0
0027: [fn hellos!|->:foo<-] (_,_,_,_,_,_,_,_)
0027: push_binding 000
0029: [fn hellos!|->:foo<-|:foo] (_,_,_,_,_,_,_,_)
0029: truncate
got frame: CallFrame: hellos!/1 @ 30
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
12..17 || times
12..17 || times
12..17 || times
12..17 || times
12..17 || times
12..17 || times
12..17 || times
12..17 || times
12..17 || times
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
29..34 || times
29..34 || times
29..34 || times
29..34 || times
29..34 || times
29..34 || times
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
38..52 || print! ("hi!")
38..52 || print! ("hi!")
46..51 || "hi!"
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
38..52 || print! ("hi!")
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
35..54 || {
print! ("hi!")
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
22..54 || repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
11..54 || (times) -> repeat times {
{
print! ("hi!")
}
}
at instr: 30
repeat times {
{
print! ("hi!")
}
}
22..54
CallFrame: user script/0 @ 35
Error: Ludus panicked! `repeat` expects a number; it got `:foo`
╭─[ sandbox.ld:1:23 ]
│
1 │ ╭─▶ fn hellos! (times) -> repeat times {
 ┆ ┆
6 │ ├─▶ hellos! (:foo)
 │ │
 │ ╰──────────────────── (1) calling `user script` with ()
───╯