about summary refs log tree commit diff stats
path: root/arc/.traces/new-fn-arg-status
blob: 5b079754cbb4826dcfff4d7918daba8f6a7ce5e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
c{0: 0 (((test1)) ((1 literal))) -- nil
c{1: 0 ✓ (((test1)) ((1 literal)))
c{0: 0 (((4 integer)) ((5 boolean)) <- ((next-input))) -- nil
c{1: 0 ✓ (((4 integer)) ((5 boolean)) <- ((next-input)))
cn0: convert-names in main
cn0: (((test1)) ((1 literal))) nil nil
cn0: checking arg ((1 literal))
cn0: convert-names in test1
cn0: (((4 integer)) ((5 boolean)) <- ((next-input))) nil nil
cn0: checking oarg ((4 integer))
maybe-add: ((4 integer))
cn0: checking oarg ((5 boolean))
maybe-add: ((5 boolean))
cn1: (((test1)) ((1 literal)))
cn1: (((4 integer)) ((5 boolean)) <- ((next-input)))
schedule: main
run: main 0: (((test1)) ((1 literal)))
run: test1/main 0: (((4 integer)) ((5 boolean)) <- ((next-input)))
arg: nil 0 (1)
run: test1/main 0: 1 => ((4 integer))
mem: ((4 integer)): 4 <= 1
run: test1/main 0: t => ((5 boolean))
mem: ((5 boolean)): 5 <= t
schedule: done with routine nil
iable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
; in mu, call-cc (http://en.wikipedia.org/wiki/Call-with-current-continuation)
; is constructed out of a combination of two primitives:
;   'current-continuation', which returns a continuation, and
;   'continue-from', which takes a continuation to

(function g [
  (c:continuation <- current-continuation)  ; <-- loop back to here
  (print-character nil:literal/terminal ((#\a literal)))
  (reply c:continuation)
])

(function f [
  (c:continuation <- g)
  (reply c:continuation)
])

(function main [
  (c:continuation <- f)
  (continue-from c:continuation)            ; <-- ..when you hit this
])