c{0: 0 (((1 string-address)) <- ((new)) a/b/c) -- nil c{0: 1 (((2 string-address-array-address)) <- ((split)) ((1 string-address)) ((/ literal))) -- nil c{1: 0 ✓ (((1 string-address)) <- ((new)) a/b/c) c{1: 1 ✓ (((2 string-address-array-address)) <- ((split)) ((1 string-address)) ((/ literal))) cn0: convert-names in main cn0: (((1 string-address)) <- ((new)) a/b/c) nil nil cn0: checking arg a/b/c cn0: checking oarg ((1 string-address)) maybe-add: ((1 string-address)) cn0: (((2 string-address-array-address)) <- ((split)) ((1 string-address)) ((/ literal))) nil nil cn0: checking arg ((1 string-address)) maybe-add: ((1 string-address)) cn0: checking arg ((/ literal)) cn0: checking oarg ((2 string-address-array-address)) maybe-add: ((2 string-address-array-address)) cn1: (((1 string-address)) <- ((new)) a/b/c) cn1: (((2 string-address-array-address)) <- ((split)) ((1 string-address)) ((/ literal))) schedule: main run: main 0: (((1 string-address)) <- ((new)) a/b/c) run: main 0: 1000 => ((1 string-address)) mem: ((1 string-address)): 1 <= 1000 run: main 1: (((2 string-address-array-address)) <- ((split)) ((1 string-address)) ((/ literal))) mem: ((1 string-address)) => 1000 run: split/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal))) run: split/main 0: 1006 => ((default-space space-address)) run: split/main 1: (((1 string-address)) <- ((next-input))) arg: nil 0 (1000 #\/) run: split/main 1: 1000 => ((1 string-address)) mem: ((1 string-address)): 1008 <= 1000 run: split/main 2: (((2 character)) <- ((next-input))) arg: nil 1 (1000 #\/) run: split/main 2: #\/ => ((2 character)) mem: ((2 character)): 1009 <= #\/ run: split/main 3: (((3 integer)) <- ((length)) ((1 string-address) (deref))) array-len: ((1 string-address) (deref)) mem: ((1000 integer) (raw)) => 5 run: split/main 3: 5 => ((3 integer)) mem: ((3 integer)): 1010 <= 5 run: split/main 4: (((4 boolean)) <- ((equal)) ((3 integer)) ((0 literal))) mem: ((3 integer)) => 5 run: split/main 4: nil => ((4 boolean)) mem: ((4 boolean)): 1011 <= nil run: split/main 5: (((jump-unless)) ((4 boolean)) ((2 offset))) mem: ((4 boolean)) => nil run: split/main 8: (((6 integer)) <- ((copy)) ((1 literal))) run: split/main 8: 1 => ((6 integer)) mem: ((6 integer)): 1013 <= 1 run: split/main 9: (((7 integer)) <- ((copy)) ((0 literal))) run: split/main 9: 0 => ((7 integer)) mem: ((7 integer)): 1014 <= 0 run: split/main 10: (((7 integer)) <- ((find-next)) ((1 string-address)) ((2 character)) ((7 integer))) mem: ((1 string-address)) => 1000 mem: ((2 character)) => / mem: ((7 integer)) => 0 run: find-next/split/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal))) run: find-next/split/main 0: 1037 => ((default-space space-address)) run: find-next/split/main 1: (((1 string-address)) <- ((next-input))) arg: nil 0 (1000 #\/ 0) run: find-next/split/main 1: 1000 => ((1 string-address)) mem: ((1 string-address)): 1039 <= 1000 run: find-next/split/main 2: (((2 character)) <- ((next-input))) arg: nil 1 (1000 #\/ 0) run: find-next/split/main 2: #\/ => ((2 character)) mem: ((2 character)): 1040 <= #\/ run: find-next/split/main 3: (((3 integer)) <- ((next-input))) arg: nil 2 (1000 #\/ 0) run: find-next/split/main 3: 0 => ((3 integer)) mem: ((3 integer)): 1041 <= 0 run: find-next/split/main 4: (((4 integer)) <- ((length)) ((1 string-address) (deref))) array-len: ((1 string-address) (deref)) mem: ((1000 integer) (raw)) => 5 run: find-next/split/main 4: 5 => ((4 integer)) mem: ((4 integer)): 1042 <= 5 run: find-next/split/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer))) mem: ((3 integer)) => 0 mem: ((4 integer)) => 5 run: find-next/split/main 5: nil => ((5 boolean)) mem: ((5 boolean)): 1043 <= nil run: find-next/split/main 6: (((jump-if)) ((5 boolean)) ((5 offset))) mem: ((5 boolean)) => nil run: find-next/split/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer))) mem: ((3 integer)) => 0 array-len: ((1000 string) (raw)) mem: ((1000 integer) (raw)) => 5 mem: ((1001 byte) (raw)) => a run: find-next/split/main 7: #\a => ((6 byte)) mem: ((6 byte)): 1044 <= #\a run: find-next/split/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character))) mem: ((6 byte)) => a mem: ((2 character)) => / run: find-next/split/main 8: nil => ((7 boolean)) mem: ((7 boolean)): 1045 <= nil run: find-next/split/main 9: (((jump-if)) ((7 boolean)) ((2 offset))) mem: ((7 boolean)) => nil run: find-next/split/main 10: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal))) mem: ((3 integer)) => 0 run: find-next/split/main 10: 1 => ((3 integer)) mem: ((3 integer)): 1041 <= 1 run: find-next/split/main 11: (((jump)) ((-7 offset))) run: find-next/split/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer))) mem: ((3 integer)) => 1 mem: ((4 integer)) => 5 run: find-next/split/main 5: nil => ((5 boolean)) mem: ((5 boolean)): 1043 <= nil run: find-next/split/main 6: (((jump-if)) ((5 boolean)) ((5 offset))) mem: ((5 boolean)) => nil run: find-next/split/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer))) mem: ((3 integer)) => 1 array-len: ((1000 string) (raw)) mem: ((1000 integer) (raw)) => 5 mem: ((1002 byte) (raw)) => / run: find-next/split/main 7: #\/ => ((6 byte)) mem: ((6 byte)): 1044 <= #\/ run: find-next/split/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character))) mem: ((6 byte)) => / mem: ((2 character)) => / run: find-next/split/main 8: t => ((7 boolean)) mem: ((7 boolean)): 1045 <= t run: find-next/split/main 9: (((jump-if)) ((7 boolean)) ((2 offset))) mem: ((7 boolean)) => t run: find-next/split/main 12: (((reply)) ((3 integer))) mem: ((3 integer)) => 1 run: split/main 10: 1 => ((7 integer)) mem: ((7 integer)): 1014 <= 1 run: split/main 11: (((8 boolean)) <- ((greater-or-equal)) ((7 integer)) ((3 integer))) mem: ((7 integer)) => 1 mem: ((3 integer)) => 5 run: split/main 11: nil => ((8 boolean)) mem: ((8 boolean)): 1015 <= nil run: split/main 12: (((jump-if)) ((8 boolean)) ((3 offset))) mem: ((8 boolean)) => nil run: split/main 13: (((7 integer)) <- ((add)) ((7 integer)) ((1 literal))) mem: ((7 integer)) => 1 run: split/main 13: 2 => ((7 integer)) mem: ((7 integer)): 1014 <= 2 run: split/main 14: (((6 integer)) <- ((add)) ((6 integer)) ((1 literal))) mem: ((6 integer)) => 1 run: split/main 14: 2 => ((6 integer)) mem: ((6 integer)): 1013 <= 2 run: split/main 15: (((jump)) ((-6 offset))) run: split/main 10: (((7 integer)) <- ((find-next)) ((1 string-address)) ((2 character)) ((7 integer))) mem: ((1 string-address)) => 1000 mem: ((2 character)) => / mem: ((7 integer)) => 2 run: find-next/split/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal))) run: find-next/split/main 0: 1068 => ((default-space space-address)) run: find-next/split/main 1: (((1 string-address)) <- ((next-input))) arg: nil 0 (1000 #\/ 2) run: find-next/split/main 1: 1000 => ((1 string-address)) mem: ((1 string-address)): 1070 <= 1000 run: find-next/split/main 2: (((2 character)) <- ((next-input))) arg: nil 1 (1000 #\/ 2) run: find-next/split/main 2: #\/ => ((2 character)) mem: ((2 character)): 1071 <= #\/ run: find-next/split/main 3: (((3 integer)) <- ((next-input))) arg: nil 2 (1000 #\/ 2) run: find-next/split/main 3: 2 => ((3 integer)) mem: ((3 integer)): 1072 <= 2 run: find-next/split/main 4: (((4 integer)) <- ((length)) ((1 string-address) (deref))) array-len: ((1 string-address) (deref)) mem: ((1000 integer) (raw)) => 5 run: find-next/split/main 4: 5 => ((4 integer)) mem: ((4 integer)): 1073 <= 5 run: find-next/split/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer))) mem: ((3 integer)) => 2 mem: ((4 integer)) => 5 run: find-next/split/main 5: nil => ((5 boolean)) mem: ((5 boolean)): 1074 <= nil run: find-next/split/main 6: (((jump-if)) ((5 boolean)) ((5 offset))) mem: ((5 boolean)) => nil run: find-next/split/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer))) mem: ((3 integer)) => 2 array-len: ((1000 string) (raw)) mem: ((1000 integer) (raw)) => 5 mem: ((1003 byte) (raw)) => b run: find-next/split/main 7: #\b => ((6 byte)) mem: ((6 byte)): 1075 <= #\b run: find-next/split/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character))) mem: ((6 byte)) => b mem: ((2 character)) => / run: find-next/split/main 8: nil => ((7 boolean)) mem: ((7 boolean)): 1076 <= nil run: find-next/split/main 9: (((jump-if)) ((7 boolean)) ((2 offset))) mem: ((7 boolean)) => nil run: find-next/split/main 10: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal))) mem: ((3 integer)) => 2 run: find-next/split/main 10: 3 => ((3 integer)) mem: ((3 integer)): 1072 <= 3 run: find-next/split/main 11: (((jump)) ((-7 offset))) run: find-next/split/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer))) mem: ((3 integer)) => 3 mem: ((4 integer)) => 5 run: find-next/split/main 5: nil => ((5 boolean)) mem: ((5 boolean)): 1074 <= nil run: find-next/split/main 6: (((jump-if)) ((5 boolean)) ((5 offset))) mem: ((5 boolean)) => nil run: find-next/split/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer))) mem: ((3 integer)) => 3 array-len: ((1000 string) (raw)) mem: ((1000 integer) (raw)) => 5 mem: ((1004 byte) (raw)) => / run: find-next/split/main 7: #\/ => ((6 byte)) mem: ((6 byte)): 1075 <= #\/ run: find-next/split/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character))) mem: ((6 byte)) => / mem: ((2 character)) => / run: find-next/split/main 8: t => ((7 boolean)) mem: ((7 boolean)): 1076 <= t run: find-next/split/main 9: (((jump-if)) ((7 boolean)) ((2 offset))) mem: ((7 boolean)) => t run: find-next/split/main 12: (((reply)) ((3 integer))) mem: ((3 integer)) => 3 run: split/main 10: 3 => ((7 integer)) mem: ((7 integer)): 1014 <= 3 run: split/main 11: (((8 boolean)) <- ((greater-or-equal)) ((7 integer)) ((3 integer))) mem: ((7 integer)) => 3 mem: ((3 integer)) => 5 run: split/main 11: nil => ((8 boolean)) mem: ((8 boolean)): 1015 <= nil run: split/main 12: (((jump-if)) ((8 boolean)) ((3 offset))) mem: ((8 boolean)) => nil run: split/main 13: (((7 integer)) <- ((add)) ((7 integer)) ((1 literal))) mem: ((7 integer)) => 3 run: split/main 13: 4 => ((7 integer)) mem: ((7 integer)): 1014 <= 4 run: split/main 14: (((6 integer)) <- ((add)) ((6 integer)) ((1 literal))) mem: ((6 integer)) => 2 run: split/main 14: 3 => ((6 integer)) mem: ((6 integer)): 1013 <= 3 run: split/main 15: (((jump)) ((-6 offset))) run: split/main 10: (((7 integer)) <- ((find-next)) ((1 string-address)) ((2 character)) ((7 integer))) mem: ((1 string-address)) => 1000 mem: ((2 character)) => / mem: ((7 integer)) => 4 run: find-next/split/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal))) run: find-next/split/main 0: 1099 => ((default-space space-address)) run: find-next/split/main 1: (((1 string-address)) <- ((next-input))) arg: nil 0 (1000 #\/ 4) run: find-next/split/main 1: 1000 => ((1 string-address)) mem: ((1 string-address)): 1101 <= 1000 run: find-next/split/main 2: (((2 character)) <- ((next-input))) arg: nil 1 (1000 #\/ 4) run: find-next/split/main 2: #\/ => ((2 character)) mem: ((2 character)): 1102 <= #\/ run: find-next/split/main 3: (((3 integer)) <- ((next-input))) arg: nil 2 (1000 #\/ 4) run: find-next/split/main 3: 4 => ((3 integer)) mem: ((3 integer)): 1103 <= 4 run: find-next/split/main 4: (((4 integer)) <- ((length)) ((1 string-address) (deref))) array-len: ((1 string-address) (deref)) mem: ((1000 integer) (raw)) => 5 run: find-next/split/main 4: 5 => ((4 integer)) mem: ((4 integer)): 1104 <= 5 run: find-next/split/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer))) mem: ((3 integer)) => 4 mem: ((4 integer)) => 5 run: find-next/split/main 5: nil => ((5 boolean)) mem: ((5 boolean)): 1105 <= nil run: find-next/split/main 6: (((jump-if)) ((5 boolean)) ((5 offset))) mem: ((5 boolean)) => nil run: find-next/split/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer))) mem: ((3 integer)) => 4 array-len: ((1000 string) (raw)) mem: ((1000 integer) (raw)) => 5 mem: ((1005 byte) (raw)) => c run: find-next/split/main 7: #\c => ((6 byte)) mem: ((6 byte)): 1106 <= #\c run: find-next/split/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character))) mem: ((6 byte)) => c mem: ((2 character)) => / run: find-next/split/main 8: nil => ((7 boolean)) mem: ((7 boolean)): 1107 <= nil run: find-next/split/main 9: (((jump-if)) ((7 boolean)) ((2 offset))) mem: ((7 boolean)) => nil run: find-next/split/main 10: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal))) mem: ((3 integer)) => 4 run: find-next/split/main 10: 5 => ((3 integer)) mem: ((3 integer)): 1103 <= 5 run: find-next/split/main 11: (((jump)) ((-7 offset))) run: find-next/split/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer))) mem: ((3 integer)) => 5 mem: ((4 integer)) => 5 run: find-next/split/main 5: t => ((5 boolean)) mem: ((5 boolean)): 110
; reads and prints keys until you hit 'q'
; no need to hit 'enter', and 'enter' has no special meaning
; dies if you wait a while, because so far we never free memory
(function main [
(default-space:space-address <- new space:literal 30:literal)
(cursor-mode)
; hook up stdin
(stdin:channel-address <- init-channel 1:literal)
;? ($print (("main: stdin is " literal)))
;? ($print stdin:channel-address)
;? ($print (("\n" literal)))
(fork-helper send-keys-to-stdin:fn nil:literal/globals nil:literal/limit nil:literal/keyboard stdin:channel-address)
; now read characters from stdin until a 'q' is typed
($print (("? " literal)))
{ begin
(x:tagged-value stdin:channel-address/deref <- read stdin:channel-address)
(c:character <- maybe-coerce x:tagged-value character:literal)
;? ($print (("main: stdin is " literal)))
;? ($print stdin:channel-address)
;? ($print (("\n" literal)))
;? ($print (("check: " literal)))
;? ($print c:character)
(done?:boolean <- equal c:character ((#\q literal)))
(break-if done?:boolean)
(loop)
}
])