aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2021-11-11 16:23:19 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commitaadcf8ad9a9b6ace9db2427bc8d2e732f30404fb (patch)
tree24f4454b5d7c22a031b351499109e0e6443bf1c9
parentlib: add time/delay! (diff)
downloadalive-aadcf8ad9a9b6ace9db2427bc8d2e732f30404fb.tar.gz
alive-aadcf8ad9a9b6ace9db2427bc8d2e732f30404fb.zip
pass input through (trace expr)
-rw-r--r--alv/builtins.moon4
-rw-r--r--spec/lang/do_spec.moon2
2 files changed, 4 insertions, 2 deletions
diff --git a/alv/builtins.moon b/alv/builtins.moon
index 78cbbbf..767202b 100644
--- a/alv/builtins.moon
+++ b/alv/builtins.moon
@@ -400,12 +400,14 @@ trace = Constant.meta
prefix: Input.cold inputs[1]
value: Input.hot inputs[2]
+ @out = inputs[2].result
+
tick: =>
L\print "trace #{@inputs.prefix!}: #{@inputs.value.result}"
eval: (scope, tail) =>
L\trace "evaling #{@}"
- assert #tail == 1, "'trace!' takes exactly one parameter"
+ assert #tail == 1, "'trace' takes exactly one parameter"
tag = @tag\clone Tag.parse '-1'
inner = Cell tag, {
diff --git a/spec/lang/do_spec.moon b/spec/lang/do_spec.moon
index 67b7b33..310a75d 100644
--- a/spec/lang/do_spec.moon
+++ b/spec/lang/do_spec.moon
@@ -14,7 +14,7 @@ describe "do", ->
assert.is.true rt\is_const!
assert.is.equal (Constant.num 3), rt.result
- rt = COPILOT\eval_once '(do 1 2 (trace 3))'
+ rt = COPILOT\eval_once '(do 1 2 (def _ 3))'
assert.is.true rt\is_const!
assert.is.nil rt.result