diff options
| author | s-ol <s+removethis@s-ol.nu> | 2021-11-11 16:23:19 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | aadcf8ad9a9b6ace9db2427bc8d2e732f30404fb (patch) | |
| tree | 24f4454b5d7c22a031b351499109e0e6443bf1c9 | |
| parent | lib: add time/delay! (diff) | |
| download | alive-aadcf8ad9a9b6ace9db2427bc8d2e732f30404fb.tar.gz alive-aadcf8ad9a9b6ace9db2427bc8d2e732f30404fb.zip | |
pass input through (trace expr)
| -rw-r--r-- | alv/builtins.moon | 4 | ||||
| -rw-r--r-- | spec/lang/do_spec.moon | 2 |
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 |
