git.s-ol.nu alive / 921be48
pass input through (trace expr) s-ol 6 months ago
2 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
399399 prefix: Input.cold inputs[1]
400400 value: Input.hot inputs[2]
401401
402 @out = inputs[2].result
403
402404 tick: =>
403405 L\print "trace #{@inputs.prefix!}: #{@inputs.value.result}"
404406
405407 eval: (scope, tail) =>
406408 L\trace "evaling #{@}"
407 assert #tail == 1, "'trace!' takes exactly one parameter"
409 assert #tail == 1, "'trace' takes exactly one parameter"
408410
409411 tag = @tag\clone Tag.parse '-1'
410412 inner = Cell tag, {
1313 assert.is.true rt\is_const!
1414 assert.is.equal (Constant.num 3), rt.result
1515
16 rt = COPILOT\eval_once '(do 1 2 (trace 3))'
16 rt = COPILOT\eval_once '(do 1 2 (def _ 3))'
1717 assert.is.true rt\is_const!
1818 assert.is.nil rt.result
1919