\e 1 / step evaluator f:{[s;q] $[not count q ;(s;q); / queue empty 100>type first q ;(s,enlist first q;1_q); / not a function not count s ;(s;q); / function, stack empty 100=type first q ;first[q][s;1_q]; / stack+queue function (-1_s;enlist[first[q]last s],1_q)]} / primitive e:f . / stack+queue functions pop:{[s;q](-1_s;q)} dup:{[s;q](s,enlist last s;q)} dip:{[s;q](-2_s;last[s],enlist[last -1_s],q)} i:{[s;q](-1_s;last[s],q)} show e scan(();(2;3;4;+;*)) show e scan(();(2;3;+;*)) show e scan(();(2;3;4;pop)) show e scan(();(2;3;enlist(+);i)) show e scan(();(2;3;4;enlist(+);dip;*)) \ / parse p:{ r:" "vs x; r:@[r;where"]"=first each r;:[;"()"]]; b:"["=first each r; r:@[r;1+where b;{"enlist[",x,"]"}]; r@:where not b; value each r} p"2 3 4 + *" p"2 3 [ 4 + ] *" show(e .)scan(();(2;3;4;+;*)) () (2;3;4;+;*) ,2 (3;4;+;*) 2 3 (4;+;*) 2 3 4 (+;*) 2 3 +[4] * ,2 (7;*) 2 7 ,* 2 *[7] `int$() ,14 ,14 `int$() show(e .)scan(();(2;3;+;*)) () (2;3;+;*) ,2 (3;+;*) 2 3 + * ,2 (+[3];*) `int$() (5;*) 5 * `int$() ,*[5]