Compare commits

..

2 Commits

Author SHA1 Message Date
Scott Richmond
49bb50ada1 build a doc file, bring in some other documentation 2025-07-07 00:10:37 -04:00
Scott Richmond
79720ba833 moar cleanup 2025-07-06 23:31:12 -04:00
13 changed files with 173 additions and 694 deletions

View File

@ -1039,7 +1039,7 @@ fn self {
() -> base :process (:self)
}
fn send {
fn send! {
"Sends a message to the specified process and returns the message."
(pid as :keyword, msg) -> {
base :process (:send, pid, msg)
@ -1052,7 +1052,7 @@ fn link! {
(pid as :keyword) -> base :process (:link, pid)
}
fn spawn! {
fn spawn {
"Spawns a process. Takes a 0-argument (nullary) function that will be executed as the new process. Returns a keyword process ID (pid) of the newly spawned process."
(f as :fn) -> {
let new_pid = base :process (:spawn, f)
@ -1061,7 +1061,7 @@ fn spawn! {
}
}
fn fledge! {
fn fledge {
"Spawns a process and then immediately unlinks from it. Takes a 0-argument (nullary) function that will be executed as the new process. Returns a keyword process ID (pid) of the newly fledged process."
(f as :fn) -> base :process (:spawn, f)
}
@ -1088,7 +1088,7 @@ fn monitor! {
else nil
}
fn flush! {
fn flush {
"Clears the current process's mailbox and returns all the messages."
() -> base :process (:flush)
}
@ -1098,7 +1098,7 @@ fn sleep! {
(ms as :number) -> base :process (:sleep, ms)
}
fn await! {
fn await {
"Parks the current process until it receives an exit signal from the passed process. Returns the result of a successful execution or panics if the awaited process panics. If the other process is not alive, returns `nil`."
(pid as :keyword) -> if monitor! (pid)
then receive {
@ -1127,7 +1127,7 @@ fn hibernate! {
() -> receive { _ -> hibernate! () }
}
fn heed! {
fn heed {
"Parks the current process until it receives a reply, and returns whatever is replied. Causes a panic if it gets anything other than a `(:reply, result)` tuple."
() -> receive {
(:reply, result) -> result
@ -1164,7 +1164,7 @@ fn request_fetch! {
}
fn fetch {
"Requests the contents of the URL passed in. Returns a result tuple of `(:ok, {contents})` or `(:err, {status code})`."
"Requests the contents of the URL passed in. Returns a result tuple of (:ok, <contents>) or (:err, <status code>)."
(url) -> {
let pid = self ()
spawn! (fn () -> request_fetch! (pid, url))
@ -1402,7 +1402,7 @@ fn turtle_listener () -> {
turtle_listener ()
}
fn spawn_turtle! {
fn spawn_turtle {
"Spawns a new turtle in a new process. Methods on the turtle process mirror those of turtle graphics functions in prelude. Returns the pid of the new turtle."
() -> {
let pid = spawn! (fn () -> turtle_listener ())
@ -1498,106 +1498,73 @@ fn llist {
}
&&& keyboard input
fn key_pressed? {
fn key_down? {
"Returns true ie the key is currently pressed. Keys are indicated by strings. For non-alphanumeric keys, consult the documentation to get key codes."
(key as :string) -> do keys_down > unbox > contains? (key, _)
}
#{
& completed actor functions
self
send
spawn! & <- is no longer a special form
yield!
sleep!
alive?
flush!
& wip actor functions
link!
monitor!
await!
heed!
unlink!
hibernate!
spawn_turtle!
key_pressed?
& shared memory w/ rust
& `box`es are actually way cool
console
input
fetch_outbox
abs & math
add & math
alive? & processes
angle & math
any? & types and values
append & lists
assert! & errors
assoc & dicts
at & tuples, strings, lists
atan/2 & math
await & processes
back! & turtle graphics
background! & turtle graphics
between? & math
bg! & turtle graphics
bk! & turtle graphics
bool & bools
bool? & bools
box? & boxes
butlast & list, tuple, string
car & llist
cdr & llist
ceil & math
chars & strings
clear! & turtle graphics
coll? & dicts, tuples, lists
colors & turtle graphics
colours & turtle graphics
concat & list string
cons & llist
console & buffers
contains? & list, tuple, string
cos & math
count & list, tuple, string
dec & math
deg/rad &math
deg/turn &math
dict & dicts
dict? & dicts
dissoc & dicts
dist & math
div & math
div/0 & math
div/safe & math
doc! & io
downcase & string
each! & list
empty? & list string dict tuple
eq? & values
err & result
err? & result
even? & math
false? & bool
fd! & turtles
fetch &
fetch_inbox
keys_down
& a fetch fn
fetch
& await user input
read_input
abs
abs
add
angle
any?
append
assert!
assoc
& assoc?
at
atan/2
back!
background!
between?
bg!
bk!
bool
bool?
box?
butlast
car
cdr
ceil
chars
clear!
coll?
colors
colours
concat
condense
cons
console
contains?
cos
count
dec
deg/rad
deg/turn
dict
dict?
dissoc
dist
div
div/0
div/safe
doc!
downcase
each!
empty?
eq?
err
err?
even?
false?
fd!
fetch_outbox
filter
first
first
first
floor
flush
fn?
fold
foldr
@ -1609,21 +1576,27 @@ fn key_pressed? {
has?
heading
heading/vector
heed
hibernate!
hideturtle!
home!
inc
indexed?
index_of
indexed?
indices_of
input
inv
inv/0
inv/safe
join
keep
key_down?
keys
keys_down
keyword?
last
left!
link!
list
list?
llist
@ -1635,6 +1608,7 @@ fn key_pressed? {
mod
mod/0
mod/safe
monitor!
mult
neg
neg?
@ -1665,6 +1639,7 @@ fn key_pressed? {
random
random_int
range
read_input
report!
rest
right!
@ -1672,15 +1647,20 @@ fn key_pressed? {
round
rt!
second
self
send!
sentence
setheading!
show
showturtle!
sin
sleep!
slice
slice_n
some
some?
spawn
spawn_turtle
split
sqrt
sqrt/safe
@ -1703,6 +1683,7 @@ fn key_pressed? {
turtle_state
type
unbox
unlink!
unwrap!
unwrap_or
upcase
@ -1711,5 +1692,6 @@ fn key_pressed? {
values
words
ws?
yield!
zero?
}

View File

@ -1,7 +1,7 @@
# A base library for Ludus
# Only loaded in the prelude
(import /src/scanner :as s)
(import /janet/scanner :as s)
(defn bool [x] (if (= :^nil x) nil x))

View File

@ -1,5 +1,5 @@
(import /src/base :as base)
(import /src/prelude :as prelude)
(import /janet/base :as base)
(import /janet/prelude :as prelude)
(defn map-values [f dict]
(from-pairs (map (fn [[k v]] [k (f v)]) (pairs dict))))
@ -23,20 +23,21 @@
(string/join (map toc-entry sorted-names) "&nbsp;&nbsp;&nbsp; "))
(def topics {
"math" ["abs" "add" "angle" "atan/2" "between?" "ceil" "cos" "dec" "deg/rad" "deg/turn" "dist" "div" "div/0" "div/safe" "even?" "floor" "gt?" "gte?" "heading/vector" "inc" "inv" "inv/0" "inv/safe" "lt?" "lte?" "max" "min" "mod" "mod/0" "mod/safe" "mult" "neg" "neg?" "odd?" "pi" "pos?" "rad/deg" "rad/turn" "random" "random_int" "range" "round" "sin" "sqrt" "sqrt/safe" "square" "sub" "sum_of_squares" "tan" "tau" "to_number" "turn/deg" "turn/rad" "zero?"]
"boolean" ["and" "bool" "bool?" "false?" "not" "or" "true?"]
"dicts" ["any?" "assoc" "assoc?" "coll?" "count" "dict" "dict?" "diff" "dissoc" "empty?" "get" "keys" "random" "update" "values"]
"lists" ["any?" "append" "at" "butlast" "coll?" "concat" "count" "each!" "empty?" "filter" "first" "fold" "join" "keep" "last" "list" "list?" "map" "ordered?" "random" "range" "rest" "second" "sentence" "slice"]
"math" ["abs" "add" "angle" "atan/2" "between?" "ceil" "cos" "dec" "deg/rad" "deg/turn" "dist" "div" "div/0" "div/safe" "even?" "floor" "gt?" "gte?" "heading/vector" "inc" "inv" "inv/0" "inv/safe" "lt?" "lte?" "max" "min" "mod" "mod/0" "mod/safe" "mult" "neg" "neg?" "odd?" "pi" "pos?" "pow" "rad/deg" "rad/turn" "random" "random_int" "range" "round" "sin" "sqrt" "sqrt/safe" "square" "sub" "sum_of_squares" "tan" "tau" "to_number" "turn/deg" "turn/rad" "zero?"]
"bools" ["and" "bool" "bool?" "false?" "not" "or" "true?"]
"dicts" ["any?" "assoc" "coll?" "count" "dict" "dict?" "diff" "dissoc" "empty?" "get" "has?" "keys" "random" "update" "values"]
"lists" ["any?" "append" "at" "butlast" "coll?" "concat" "count" "each!" "empty?" "filter" "first" "fold" "index_of" "indexed?" "indices_of" "join" "keep" "last" "list" "list?" "map" "random" "range" "rest" "second" "sentence" "slice"]
"llists" ["car" "cdr" "cons" "llist"]
"sets" ["any?" "append" "coll?" "concat" "contains?" "count" "empty?" "omit" "random" "set" "set?"]
# "sets" ["any?" "append" "coll?" "concat" "contains?" "count" "empty?" "omit" "random" "set" "set?"]
"tuples" ["any?" "at" "coll?" "count" "empty?" "first" "last" "ordered?" "rest" "second" "tuple?"]
"strings" ["any?" "chars" "chars/safe" "concat" "count" "downcase" "empty?" "join" "sentence" "show" "slice" "split" "string" "string?" "strip" "to_number" "trim" "upcase" "words"]
"types and values" ["assoc?" "bool?" "box?" "coll?" "dict?" "eq?" "fn?" "keyword?" "list?" "neq?" "nil?" "number?" "ordered?" "set?" "show" "some" "some?" "string?" "tuple?" "type"]
"boxes and state" ["box?" "unbox" "store!" "update!"]
"strings" ["any?" "at" "chars" "chars/safe" "concat" "count" "downcase" "empty?" "join" "sentence" "show" "slice" "slice_n" "split" "string" "string?" "strip" "to_number" "trim" "upcase" "words"]
"types and values" ["bool?" "box?" "coll?" "dict?" "eq?" "fn?" "indexed?" "keyword?" "list?" "nil?" "number?" "set?" "show" "some" "some?" "string?" "tuple?" "type"]
"boxes" ["box?" "unbox" "store!" "update!"]
"results" ["err" "err?" "ok" "ok?" "unwrap!" "unwrap_or"]
"errors" ["assert!"]
"turtle graphics" ["back!" "background!" "bk!" "clear!" "colors" "fd!" "forward!" "goto!" "heading" "heading/vector" "hideturtle!" "home!" "left!" "loadstate!" "lt!" "pc!" "pd!" "pencolor" "pencolor!" "pendown!" "pendown?" "penup!" "penwidth" "penwidth!" "position" "pu!" "pw!" "render_turtle!" "reset_turtle!" "right!" "rt!" "setheading!" "showturtle!" "turtle_state"]
"environment and i/o" ["doc!" "print!" "report!" "state"]
"turtle graphics" ["back!" "background!" "bk!" "clear!" "colors" "fd!" "forward!" "goto!" "heading" "heading/vector" "hideturtle!" "home!" "left!" "loadstate!" "lt!" "pc!" "pd!" "pencolor" "pencolour" "pencolor!" "pencolour!" "pendown!" "pendown?" "penup!" "penwidth" "penwidth!" "position" "pu!" "pw!" "render_turtle!" "reset_turtle!" "right!" "rt!" "setheading!" "showturtle!" "spawn_turtle" "turtle_state"]
"environment and i/o" ["console" "doc!" "fetch_inbox" "fetch_outbox" "input" "key_down?" "keys_down" "print!" "read_input" "report!"]
"processes" ["alive?" "await" "fledge" "flush" "heed" "hibernate!" "monitor" "self" "send!" "sleep!" "spawn" "unlink!" "yield!"]
})
(defn capitalize [str]

View File

@ -1,4 +1,4 @@
(import /src/base :as b)
(import /janet/base :as b)
(defn- get-line [source line]
((string/split "\n" source) (dec line)))

View File

@ -1,6 +1,6 @@
# A tree walk interpreter for ludus
(import /src/base :as b)
(import /janet/base :as b)
(var interpret nil)
(var match-pattern nil)

View File

@ -2,14 +2,14 @@
# devised in order to run under wasm
# takes a string, returns a string with a json object
# (try (os/cd "janet") ([_] nil)) # for REPL
(import /src/scanner :as s)
(import /src/parser :as p)
(import /src/validate :as v)
(import /src/interpreter :as i)
(import /src/errors :as e)
(import /src/base :as b)
(import /src/prelude :as prelude)
(import /src/json :as j)
(import /janet/scanner :as s)
(import /janet/parser :as p)
(import /janet/validate :as v)
(import /janet/interpreter :as i)
(import /janet/errors :as e)
(import /janet/base :as b)
(import /janet/prelude :as prelude)
(import /janet/json :as j)
(defn ludus [source]
# if we can't load prelude, bail

View File

@ -1,7 +1,7 @@
### A recursive descent parser for Ludus
### We still need to scan some things
(import /src/scanner :as s)
(import /janet/scanner :as s)
# stash janet type
(def janet-type type)
@ -698,6 +698,25 @@
@{:type :match :data [to-match clauses] :token origin})
([err] err)))
(defn- receive [parser]
(def origin (current parser))
(def ast {:type :receive :data @[] :token origin})
(def clauses @[])
(expect parser :receive)
(advance parser)
(try
(do
(def open-brace (current parser))
(expect parser :lbrace) (advance parser)
(accept-many parser :newline)
(while (not (check parser :rbrace))
(when (check parser :eof)
(error {:type :error :token open-brace :msg "unclosed brace"}))
(array/push clauses (match-clause parser)))
(advance parser)
@{:type :receive :data [clauses] :token origin})
([err] err)))
# {pattern} = {nonbinding} {terminators}
(defn- with-clause [parser]
(try
@ -973,7 +992,7 @@
(def body (nonbinding parser))
{:type :test :data [desc body] :token origin})
### loops and repeates
### loops and repeats
(defn- loopp [parser]
(def origin (current parser))
(expect parser :loop) (advance parser)
@ -1031,9 +1050,10 @@
:startdict (dict parser)
:startset (sett parser)
:word (word-expr parser)
:pkg-name (pkg-name parser)
# :pkg-name (pkg-name parser)
:recur (recur parser)
:panic (panicc parser)
:do (doo parser)
(panic parser (string "expected simple expression, got " (type curr)))
)
)
@ -1072,6 +1092,7 @@
:when (whenn parser)
:match (matchh parser)
:with (withh parser)
:receive (receive parser)
# do
:do (doo parser)
@ -1114,12 +1135,13 @@
:startdict (dict parser)
:startset (sett parser)
:word (word-expr parser)
:pkg-name (pkg-name parser)
# :pkg-name (pkg-name parser)
:recur (recur parser)
:if (iff parser)
:when (whenn parser)
:match (matchh parser)
:with (withh parser)
:receive (receive parser)
# :with (withh parser)
:do (doo parser)
:lbrace (block parser)
:loop (loopp parser)

View File

@ -1,20 +1,20 @@
(import /src/base :as b)
(import /src/scanner :as s)
(import /src/parser :as p)
(import /src/validate :as v)
(import /src/interpreter :as i)
(import /src/errors :as e)
(import /janet/base :as b)
(import /janet/scanner :as s)
(import /janet/parser :as p)
(import /janet/validate :as v)
(import /janet/interpreter :as i)
(import /janet/errors :as e)
(def pkg (do
(def pre-ctx @{:^parent {"base" b/base}})
(def pre-src (slurp "../assets/prelude.ld"))
(def pre-src (slurp "./assets/prelude.ld"))
(def pre-scanned (s/scan pre-src :prelude))
(def pre-parsed (p/parse pre-scanned))
(def parse-errors (pre-parsed :errors))
(when (any? parse-errors) (each err parse-errors (e/parse-error err)) (break :error))
(def pre-validated (v/valid pre-parsed pre-ctx))
(def validation-errors (pre-validated :errors))
(when (any? validation-errors) (each err validation-errors (e/validation-error err)) (break :error))
# (def pre-validated (v/valid pre-parsed pre-ctx))
# (def validation-errors (pre-validated :errors))
# (when (any? validation-errors) (each err validation-errors (e/validation-error err)) (break :error))
(try
(i/interpret (pre-parsed :ast) pre-ctx)
([err] (e/runtime-error err) :error))))
@ -27,16 +27,16 @@
(set (ctx "^type") nil)
ctx))
(def post/src (slurp "postlude.ld"))
# (def post/src (slurp "postlude.ld"))
(def post/ast (do
(def post-ctx @{:^parent ctx})
(def post-scanned (s/scan post/src :postlude))
(def post-parsed (p/parse post-scanned))
(def parse-errors (post-parsed :errors))
(when (any? parse-errors) (each err parse-errors (e/parse-error err)) (break :error))
(def post-validated (v/valid post-parsed post-ctx))
(def validation-errors (post-validated :errors))
(when (any? validation-errors) (each err validation-errors (e/validation-error err)) (break :error))
(post-parsed :ast)))
# (def post/ast (do
# (def post-ctx @{:^parent ctx})
# (def post-scanned (s/scan post/src :postlude))
# (def post-parsed (p/parse post-scanned))
# (def parse-errors (post-parsed :errors))
# (when (any? parse-errors) (each err parse-errors (e/parse-error err)) (break :error))
# # (def post-validated (v/valid post-parsed post-ctx))
# # (def validation-errors (post-validated :errors))
# # (when (any? validation-errors) (each err validation-errors (e/validation-error err)) (break :error))
# (post-parsed :ast)))

View File

@ -9,20 +9,21 @@
"false" :false ## impl -> literal word
"fn" :fn ## impl
"if" :if ## impl
"import" :import ## impl
# "import" :import ## impl
"let" :let ## impl
"loop" :loop ## impl
"match" :match ## impl
"nil" :nil ## impl -> literal word
"ns" :ns ## impl
# "ns" :ns ## impl
"panic!" :panic ## impl (should _not_ be a function)
"pkg" :pkg
# "pkg" :pkg
"receive" :receive
"recur" :recur ## impl
"repeat" :repeat ## impl
"test" :test
# "test" :test
"then" :then ## impl
"true" :true ## impl -> literal word
"use" :use ## wip
# "use" :use ## wip
"when" :when ## impl, replaces cond
"with" :with ## impl
})

View File

@ -286,6 +286,13 @@ Deferred until a later iteration of Ludus:
(match-clauses validator clauses)
validator)
(defn- receive [validator]
(def ast (validator :ast))
(def [clauses] (ast :data))
(match-clauses validator clauses)
validator)
(defn- declare [validator fnn]
(def status (validator :status))
(def declared (get status :declared @{}))
@ -758,6 +765,7 @@ Deferred until a later iteration of Ludus:
:loop (loopp validator)
:recur (recur validator)
:box (box validator)
:receive (receive validator)
(error (string "unknown node type " type)))))
(set validate validate*)

View File

@ -38,3 +38,8 @@ release:
serve:
live-server pkg
# build the documentation
doc:
janet janet/doc.janet
-rm doc/prelude.md
mv prelude.md doc/

View File

@ -1,249 +0,0 @@
=== vm run: test ===
0000: [] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [] (_,_,_,_,_,_,_,_)
0001: constant 00000: 2
0004: [->2<-] (_,_,_,_,_,_,_,_)
0004: match
0005: [->2<-] (_,_,_,_,_,_,_,_)
0005: panic_if_no_match
0006: [->2<-] (_,_,_,_,_,_,_,_)
0006: push_list
0007: [->2<-|[]] (_,_,_,_,_,_,_,_)
0007: constant 00001: 1
0010: [->2<-|[]|1] (_,_,_,_,_,_,_,_)
0010: append_list
0011: [->2<-|[1]] (_,_,_,_,_,_,_,_)
0011: constant 00000: 2
0014: [->2<-|[1]|2] (_,_,_,_,_,_,_,_)
0014: append_list
0015: [->2<-|[1, 2]] (_,_,_,_,_,_,_,_)
0015: constant 00002: 3
0018: [->2<-|[1, 2]|3] (_,_,_,_,_,_,_,_)
0018: append_list
0019: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0019: ***entering loop with stack depth of 2
0021: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0021: store_n 001
0023: [->2<-] ([1, 2, 3],_,_,_,_,_,_,_)
0023: ***after store, stack depth is now 2
0025: [->2<-] ([1, 2, 3],_,_,_,_,_,_,_)
0025: load
0026: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0026: ***after load, stack depth is now 2
0028: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0028: reset_match
0029: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0029: match_depth 000
0031: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0031: match_list 000
0033: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0033: jump_if_no_match 00006
0042: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0042: jump_if_no_match 00010
0055: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0055: reset_match
0056: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0056: match_depth 000
0058: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0058: match_list 001
0060: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0060: jump_if_no_match 00012
0075: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0075: jump_if_no_match 00030
0108: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0108: reset_match
0109: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0109: match_depth 000
0111: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0111: match_splatted_list 002
0113: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0113: jump_if_no_match 00019
0116: [->2<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0116: load_splatted_list 002
0118: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0118: match_depth 001
0120: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0120: match
0121: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0121: jump_if_no_match 00010
0124: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0124: match_depth 000
0126: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0126: match
0127: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0127: jump_if_no_match 00004
0130: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0130: jump 00002
0135: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0135: jump_if_no_match 00068
0138: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0138: ***before visiting body, the stack depth is 4
0140: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0140: ***calling function eq? stack depth: 4
0142: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0142: ***calling function first stack depth: 4
0144: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0144: resolving binding `xs` in test
0146: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0146: push_binding 003
0148: [->2<-|[1, 2, 3]|1|[2, 3]|[2, 3]] (_,_,_,_,_,_,_,_)
0148: resolving binding `first` in test
0150: [->2<-|[1, 2, 3]|1|[2, 3]|[2, 3]] (_,_,_,_,_,_,_,_)
0150: constant 00004: :first
0153: [->2<-|[1, 2, 3]|1|[2, 3]|[2, 3]|:first] (_,_,_,_,_,_,_,_)
0153: push_global
0154: [->2<-|[1, 2, 3]|1|[2, 3]|[2, 3]|fn first] (_,_,_,_,_,_,_,_)
0154: ***after 1 args stack depth: 6
0156: [->2<-|[1, 2, 3]|1|[2, 3]|[2, 3]|fn first] (_,_,_,_,_,_,_,_)
0156: call 001
=== calling into fn first/1 ===
0000: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0001: match_depth 000
0003: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0003: match_list 000
0005: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0005: jump_if_no_match 00006
0014: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0014: jump_if_no_match 00003
0020: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0020: jump_if_no_match 00005
0028: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0028: match_depth 000
0030: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0030: constant 00000: :list
0033: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|:list] (_,_,_,_,_,_,_,_)
0033: match_type
0034: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0034: jump_if_no_match 00003
0037: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0037: jump 00000
0040: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0040: jump_if_no_match 00024
0043: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0043: ***accessing keyword: base :first stack depth: 1
0045: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0045: resolving binding `base` in first
0047: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0047: get_upvalue 000
0049: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|#{:rest fn rest/base...] (_,_,_,_,_,_,_,_)
0049: constant 00001: :first
0052: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|#{:rest fn rest/base...|:first] (_,_,_,_,_,_,_,_)
0052: get_key
0053: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|fn first/base] (_,_,_,_,_,_,_,_)
0053: ***after keyword access stack depth: 2
0055: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|fn first/base] (_,_,_,_,_,_,_,_)
0055: stash
0056: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|fn first/base] (fn first/base,_,_,_,_,_,_,_)
0056: pop
0057: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (fn first/base,_,_,_,_,_,_,_)
0057: resolving binding `xs` in first
0059: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (fn first/base,_,_,_,_,_,_,_)
0059: push_binding 000
0061: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|[2, 3]] (fn first/base,_,_,_,_,_,_,_)
0061: load
0062: [2|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|[2, 3]|fn first/base] (_,_,_,_,_,_,_,_)
0062: tail_call 001
=== tail call into fn first/base/1 from first ===
0158: [->2<-|[1, 2, 3]|1|[2, 3]|2] (_,_,_,_,_,_,_,_)
0158: resolving binding `test` in test
0160: [->2<-|[1, 2, 3]|1|[2, 3]|2] (_,_,_,_,_,_,_,_)
0160: push_binding 000
0162: [->2<-|[1, 2, 3]|1|[2, 3]|2|2] (_,_,_,_,_,_,_,_)
0162: resolving binding `eq?` in test
0164: [->2<-|[1, 2, 3]|1|[2, 3]|2|2] (_,_,_,_,_,_,_,_)
0164: constant 00003: :eq?
0167: [->2<-|[1, 2, 3]|1|[2, 3]|2|2|:eq?] (_,_,_,_,_,_,_,_)
0167: push_global
0168: [->2<-|[1, 2, 3]|1|[2, 3]|2|2|fn eq?] (_,_,_,_,_,_,_,_)
0168: ***after 2 args stack depth: 7
0170: [->2<-|[1, 2, 3]|1|[2, 3]|2|2|fn eq?] (_,_,_,_,_,_,_,_)
0170: call 002
=== calling into fn eq?/2 ===
0000: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0001: match_depth 001
0003: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0003: match
0004: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0004: jump_if_no_match 00009
0007: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0007: match_depth 000
0009: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0009: match
0010: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0010: jump_if_no_match 00003
0013: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0013: jump 00000
0016: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0016: jump_if_no_match 00029
0019: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0019: ***accessing keyword: base :eq? stack depth: 2
0021: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0021: resolving binding `base` in eq?
0023: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (_,_,_,_,_,_,_,_)
0023: get_upvalue 000
0025: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|#{:rest fn rest/base...] (_,_,_,_,_,_,_,_)
0025: constant 00000: :eq?
0028: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|#{:rest fn rest/base...|:eq?] (_,_,_,_,_,_,_,_)
0028: get_key
0029: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|fn eq?/base] (_,_,_,_,_,_,_,_)
0029: ***after keyword access stack depth: 3
0031: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|fn eq?/base] (_,_,_,_,_,_,_,_)
0031: stash
0032: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|fn eq?/base] (fn eq?/base,_,_,_,_,_,_,_)
0032: pop
0033: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (fn eq?/base,_,_,_,_,_,_,_)
0033: resolving binding `x` in eq?
0035: [2|[1, 2, 3]|1|[2, 3]|->2<-|2] (fn eq?/base,_,_,_,_,_,_,_)
0035: push_binding 000
0037: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|2] (fn eq?/base,_,_,_,_,_,_,_)
0037: resolving binding `y` in eq?
0039: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|2] (fn eq?/base,_,_,_,_,_,_,_)
0039: push_binding 001
0041: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|2|2] (fn eq?/base,_,_,_,_,_,_,_)
0041: load
0042: [2|[1, 2, 3]|1|[2, 3]|->2<-|2|2|2|fn eq?/base] (_,_,_,_,_,_,_,_)
0042: tail_call 002
=== tail call into fn eq?/base/2 from eq? ===
0172: [->2<-|[1, 2, 3]|1|[2, 3]|true] (_,_,_,_,_,_,_,_)
0172: jump_if_false 00004
0175: [->2<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0175: true
0176: [->2<-|[1, 2, 3]|1|[2, 3]|true] (_,_,_,_,_,_,_,_)
0176: jump 00018
0197: [->2<-|[1, 2, 3]|1|[2, 3]|true] (_,_,_,_,_,_,_,_)
0197: ***after visiting loop body, the stack depth is 5
0199: [->2<-|[1, 2, 3]|1|[2, 3]|true] (_,_,_,_,_,_,_,_)
0199: store
0200: [->2<-|[1, 2, 3]|1|[2, 3]|_] (true,_,_,_,_,_,_,_)
0200: pop
0201: [->2<-|[1, 2, 3]|1|[2, 3]] (true,_,_,_,_,_,_,_)
0201: pop
0202: [->2<-|[1, 2, 3]|1] (true,_,_,_,_,_,_,_)
0202: pop
0203: [->2<-|[1, 2, 3]] (true,_,_,_,_,_,_,_)
0203: jump 00001
0207: [->2<-|[1, 2, 3]] (true,_,_,_,_,_,_,_)
0207: load
0208: [->2<-|[1, 2, 3]|true] (_,_,_,_,_,_,_,_)
0208: store
0209: [->2<-|[1, 2, 3]|_] (true,_,_,_,_,_,_,_)
0209: pop_n 002
0211: [->2<-] (true,_,_,_,_,_,_,_)
0211: load
0212: [->2<-] (_,_,_,_,_,_,_,_)
true
**********
**********

View File

@ -1,291 +0,0 @@
=== vm run: test ===
0000: [] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [] (_,_,_,_,_,_,_,_)
0001: constant 00000: 4
0004: [->4<-] (_,_,_,_,_,_,_,_)
0004: match
0005: [->4<-] (_,_,_,_,_,_,_,_)
0005: panic_if_no_match
0006: [->4<-] (_,_,_,_,_,_,_,_)
0006: push_list
0007: [->4<-|[]] (_,_,_,_,_,_,_,_)
0007: constant 00001: 1
0010: [->4<-|[]|1] (_,_,_,_,_,_,_,_)
0010: append_list
0011: [->4<-|[1]] (_,_,_,_,_,_,_,_)
0011: constant 00002: 2
0014: [->4<-|[1]|2] (_,_,_,_,_,_,_,_)
0014: append_list
0015: [->4<-|[1, 2]] (_,_,_,_,_,_,_,_)
0015: constant 00003: 3
0018: [->4<-|[1, 2]|3] (_,_,_,_,_,_,_,_)
0018: append_list
0019: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0019: ***entering loop with stack depth of 2
0021: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0021: store_n 001
0023: [->4<-] ([1, 2, 3],_,_,_,_,_,_,_)
0023: ***after store, stack depth is now 2
0025: [->4<-] ([1, 2, 3],_,_,_,_,_,_,_)
0025: load
0026: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0026: ***after load, stack depth is now 2
0028: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0028: reset_match
0029: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0029: match_depth 000
0031: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0031: match_list 000
0033: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0033: jump_if_no_match 00006
0042: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0042: jump_if_no_match 00010
0055: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0055: reset_match
0056: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0056: match_depth 000
0058: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0058: match_list 001
0060: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0060: jump_if_no_match 00012
0075: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0075: jump_if_no_match 00030
0108: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0108: reset_match
0109: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0109: match_depth 000
0111: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0111: match_splatted_list 002
0113: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0113: jump_if_no_match 00019
0116: [->4<-|[1, 2, 3]] (_,_,_,_,_,_,_,_)
0116: load_splatted_list 002
0118: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0118: match_depth 001
0120: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0120: match
0121: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0121: jump_if_no_match 00010
0124: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0124: match_depth 000
0126: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0126: match
0127: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0127: jump_if_no_match 00004
0130: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0130: jump 00002
0135: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0135: jump_if_no_match 00068
0138: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0138: ***before visiting body, the stack depth is 4
0140: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0140: ***calling function eq? stack depth: 4
0142: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0142: ***calling function first stack depth: 4
0144: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0144: resolving binding `xs` in test
0146: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0146: push_binding 003
0148: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]] (_,_,_,_,_,_,_,_)
0148: resolving binding `first` in test
0150: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]] (_,_,_,_,_,_,_,_)
0150: constant 00005: :first
0153: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]|:first] (_,_,_,_,_,_,_,_)
0153: push_global
0154: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]|fn first] (_,_,_,_,_,_,_,_)
0154: ***after 1 args stack depth: 6
0156: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]|fn first] (_,_,_,_,_,_,_,_)
0156: call 001
=== calling into fn first/1 ===
0000: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0001: match_depth 000
0003: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0003: match_list 000
0005: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0005: jump_if_no_match 00006
0014: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0014: jump_if_no_match 00003
0020: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0020: jump_if_no_match 00005
0028: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0028: match_depth 000
0030: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0030: constant 00000: :list
0033: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|:list] (_,_,_,_,_,_,_,_)
0033: match_type
0034: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0034: jump_if_no_match 00003
0037: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0037: jump 00000
0040: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0040: jump_if_no_match 00024
0043: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0043: ***accessing keyword: base :first stack depth: 1
0045: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0045: resolving binding `base` in first
0047: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (_,_,_,_,_,_,_,_)
0047: get_upvalue 000
0049: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|#{:append fn append/...] (_,_,_,_,_,_,_,_)
0049: constant 00001: :first
0052: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|#{:append fn append/...|:first] (_,_,_,_,_,_,_,_)
0052: get_key?
0053: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|fn first/base] (_,_,_,_,_,_,_,_)
0053: ***after keyword access stack depth: 2
0055: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|fn first/base] (_,_,_,_,_,_,_,_)
0055: stash
0056: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|fn first/base] (fn first/base,_,_,_,_,_,_,_)
0056: pop
0057: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (fn first/base,_,_,_,_,_,_,_)
0057: resolving binding `xs` in first
0059: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-] (fn first/base,_,_,_,_,_,_,_)
0059: push_binding 000
0061: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|[2, 3]] (fn first/base,_,_,_,_,_,_,_)
0061: load
0062: [4|[1, 2, 3]|1|[2, 3]|->[2, 3]<-|[2, 3]|fn first/base] (_,_,_,_,_,_,_,_)
0062: tail_call 001
=== tail call into fn first/base/1 from first ===
0158: [->4<-|[1, 2, 3]|1|[2, 3]|2] (_,_,_,_,_,_,_,_)
0158: resolving binding `test` in test
0160: [->4<-|[1, 2, 3]|1|[2, 3]|2] (_,_,_,_,_,_,_,_)
0160: push_binding 000
0162: [->4<-|[1, 2, 3]|1|[2, 3]|2|4] (_,_,_,_,_,_,_,_)
0162: resolving binding `eq?` in test
0164: [->4<-|[1, 2, 3]|1|[2, 3]|2|4] (_,_,_,_,_,_,_,_)
0164: constant 00004: :eq?
0167: [->4<-|[1, 2, 3]|1|[2, 3]|2|4|:eq?] (_,_,_,_,_,_,_,_)
0167: push_global
0168: [->4<-|[1, 2, 3]|1|[2, 3]|2|4|fn eq?] (_,_,_,_,_,_,_,_)
0168: ***after 2 args stack depth: 7
0170: [->4<-|[1, 2, 3]|1|[2, 3]|2|4|fn eq?] (_,_,_,_,_,_,_,_)
0170: call 002
=== calling into fn eq?/2 ===
0000: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0000: reset_match
0001: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0001: match_depth 001
0003: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0003: match
0004: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0004: jump_if_no_match 00009
0007: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0007: match_depth 000
0009: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0009: match
0010: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0010: jump_if_no_match 00003
0013: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0013: jump 00000
0016: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0016: jump_if_no_match 00029
0019: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0019: ***accessing keyword: base :eq? stack depth: 2
0021: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0021: resolving binding `base` in eq?
0023: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (_,_,_,_,_,_,_,_)
0023: get_upvalue 000
0025: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|#{:append fn append/...] (_,_,_,_,_,_,_,_)
0025: constant 00000: :eq?
0028: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|#{:append fn append/...|:eq?] (_,_,_,_,_,_,_,_)
0028: get_key
0029: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|fn eq?/base] (_,_,_,_,_,_,_,_)
0029: ***after keyword access stack depth: 3
0031: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|fn eq?/base] (_,_,_,_,_,_,_,_)
0031: stash
0032: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|fn eq?/base] (fn eq?/base,_,_,_,_,_,_,_)
0032: pop
0033: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (fn eq?/base,_,_,_,_,_,_,_)
0033: resolving binding `x` in eq?
0035: [4|[1, 2, 3]|1|[2, 3]|->2<-|4] (fn eq?/base,_,_,_,_,_,_,_)
0035: push_binding 000
0037: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|2] (fn eq?/base,_,_,_,_,_,_,_)
0037: resolving binding `y` in eq?
0039: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|2] (fn eq?/base,_,_,_,_,_,_,_)
0039: push_binding 001
0041: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|2|4] (fn eq?/base,_,_,_,_,_,_,_)
0041: load
0042: [4|[1, 2, 3]|1|[2, 3]|->2<-|4|2|4|fn eq?/base] (_,_,_,_,_,_,_,_)
0042: tail_call 002
=== tail call into fn eq?/base/2 from eq? ===
0172: [->4<-|[1, 2, 3]|1|[2, 3]|false] (_,_,_,_,_,_,_,_)
0172: jump_if_false 00004
0179: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0179: before visiting recur args the compiler thinks the stack depth is 5
0181: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0181: recur arg: 0
0183: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0183: resolving binding `xs` in test
0185: [->4<-|[1, 2, 3]|1|[2, 3]] (_,_,_,_,_,_,_,_)
0185: push_binding 003
0187: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]] (_,_,_,_,_,_,_,_)
0187: after visiting recur args the compiler thinks the stack depth is 6
0189: [->4<-|[1, 2, 3]|1|[2, 3]|[2, 3]] (_,_,_,_,_,_,_,_)
0189: store_n 001
0191: [->4<-|[1, 2, 3]|1|[2, 3]] ([2, 3],_,_,_,_,_,_,_)
0191: pop_n 004
0193: [] ([2, 3],_,_,_,_,_,_,_)
0193: load
0194: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0194: jump_back 00168
0026: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0026: ***after load, stack depth is now 2
0028: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0028: reset_match
0029: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0029: match_depth 000
0031: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0031: match_list 000
0033: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0033: jump_if_no_match 00006
0042: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0042: jump_if_no_match 00010
0055: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0055: reset_match
0056: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0056: match_depth 000
0058: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0058: match_list 001
0060: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0060: jump_if_no_match 00012
0075: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0075: jump_if_no_match 00030
0108: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0108: reset_match
0109: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0109: match_depth 000
0111: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0111: match_splatted_list 002
0113: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0113: jump_if_no_match 00019
0116: [->[2, 3]<-] (_,_,_,_,_,_,_,_)
0116: load_splatted_list 002
0118: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0118: match_depth 001
0120: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0120: match
0121: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0121: jump_if_no_match 00010
0124: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0124: match_depth 000
0126: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0126: match
0127: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0127: jump_if_no_match 00004
0130: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0130: jump 00002
0135: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0135: jump_if_no_match 00068
0138: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0138: ***before visiting body, the stack depth is 4
0140: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0140: ***calling function eq? stack depth: 4
0142: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0142: ***calling function first stack depth: 4
0144: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0144: resolving binding `xs` in test
0146: [->[2, 3]<-|2|[3]] (_,_,_,_,_,_,_,_)
0146: push_binding 003
thread 'main' panicked at src/vm.rs:313:51:
index out of bounds: the len is 3 but the index is 3