Compare commits
No commits in common. "a30cbaebc691f71404d847d5c90276d7d452f9a3" and "e05043e375e844617249c2fdc4d836e2410071e2" have entirely different histories.
a30cbaebc6
...
e05043e375
Binary file not shown.
|
@ -6489,7 +6489,7 @@ var __emscripten_stack_alloc = (a0) => (__emscripten_stack_alloc = wasmExports['
|
|||
var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
|
||||
var ___cxa_is_pointer_type = createExportWrapper('__cxa_is_pointer_type', 1);
|
||||
var dynCall_jiji = Module['dynCall_jiji'] = createExportWrapper('dynCall_jiji', 5);
|
||||
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1838072;
|
||||
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1837508;
|
||||
function invoke_i(index) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
|
|
BIN
build/out.wasm
BIN
build/out.wasm
Binary file not shown.
17
prelude.ld
17
prelude.ld
|
@ -44,7 +44,6 @@ fn ordered? {
|
|||
"Returns true if a value is an indexed collection: list or tuple."
|
||||
(coll as :list) -> true
|
||||
(coll as :tuple) -> true
|
||||
(coll as :string) -> true
|
||||
(_) -> false
|
||||
}
|
||||
|
||||
|
@ -139,7 +138,6 @@ fn rest {
|
|||
(()) -> ()
|
||||
(xs as :list) -> base :rest (xs)
|
||||
(xs as :tuple) -> base :rest (xs)
|
||||
(xs as :string) -> base :str_slice (xs, 1)
|
||||
}
|
||||
|
||||
fn inc {
|
||||
|
@ -631,13 +629,10 @@ fn at {
|
|||
"Returns the element at index n of a list or tuple, or the byte at index n of a string. Zero-indexed: the first element is at index 0. Returns nil if nothing is found in a list or tuple; returns an empty string if nothing is found in a string."
|
||||
(xs as :list, n as :number) -> base :nth (n, xs)
|
||||
(xs as :tuple, n as :number) -> base :nth (n, xs)
|
||||
(str as :string, n as :number) -> {
|
||||
let raw = base :nth (n, str)
|
||||
when {
|
||||
nil? (raw) -> nil
|
||||
gte? (raw, 128) -> panic! "not an ASCII char"
|
||||
true -> raw
|
||||
}
|
||||
(str as :string, n as :number) -> when {
|
||||
neg? (n) -> ""
|
||||
gte? (n, count (str)) -> ""
|
||||
true -> base :slice (str, n, inc (n))
|
||||
}
|
||||
(_) -> nil
|
||||
}
|
||||
|
@ -1288,9 +1283,7 @@ fn apply_command {
|
|||
(:home) -> do state >
|
||||
assoc (_, :position, (0, 0)) >
|
||||
assoc (_, :heading, 0)
|
||||
(:clear) -> do state >
|
||||
assoc (state, :position, (0, 0)) >
|
||||
assoc (_, :heading, 0)
|
||||
(:clear) -> assoc (state, :position, (0, 0))
|
||||
(:right, turns) -> update (state, :heading, add (_, turns))
|
||||
(:left, turns) -> update (state, :heading, sub (_, turns))
|
||||
(:forward, steps) -> {
|
||||
|
|
|
@ -640,7 +640,7 @@
|
|||
# # (when (has-errors? validated) (break (validated :errors)))
|
||||
# # (def cleaned (get-in parsed [:ast :data 1]))
|
||||
# # # (pp cleaned)
|
||||
# (interpret (parsed :ast) @{:^parent b/lett})
|
||||
# (interpret (parsed :ast) @{:^parent b/ctx})
|
||||
# # (try (interpret (parsed :ast) @{:^parent b/ctx})
|
||||
# # ([e] (if (struct? e) (error (e :msg)) (error e))))
|
||||
# )
|
||||
|
|
|
@ -51,18 +51,18 @@
|
|||
|
||||
(comment
|
||||
# (do
|
||||
(def source `
|
||||
add (1, 2)
|
||||
`)
|
||||
(def out (-> source
|
||||
ludus
|
||||
j/decode
|
||||
))
|
||||
(setdyn :out stdout)
|
||||
# (pp out)
|
||||
(def console (out "console"))
|
||||
(print console)
|
||||
(def result (out "result"))
|
||||
(print result)
|
||||
(def source `
|
||||
contains? (:d, [:a, :b])
|
||||
`)
|
||||
(def out (-> source
|
||||
ludus
|
||||
j/decode
|
||||
))
|
||||
(setdyn :out stdout)
|
||||
(pp out)
|
||||
(def console (out "console"))
|
||||
(print console)
|
||||
(def result (out "result"))
|
||||
(print result)
|
||||
)
|
||||
|
||||
|
|
|
@ -1117,10 +1117,10 @@
|
|||
# (do
|
||||
(comment
|
||||
(def source `
|
||||
let foo = :bar
|
||||
"{f} a {f}"
|
||||
`)
|
||||
(def scanned (s/scan source))
|
||||
# (print "\n***NEW PARSE***\n")
|
||||
(def a-parser (new-parser scanned))
|
||||
(def parsed (lett a-parser))
|
||||
(def parsed (interpolated a-parser))
|
||||
)
|
||||
|
|
|
@ -350,6 +350,6 @@
|
|||
|
||||
(comment
|
||||
# (do
|
||||
(def source "add 1 2 () four")
|
||||
(def source "/iii")
|
||||
(scan source)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user