All pastes #906473 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-16 19:04 UTC
rendered paste body
fn id {ret $0}
fn dbl {+ $0 $0}
fn do {body while cond} {
   eval $body 1
   while $cond {eval $body 1}
}

call [fn {+ $0 $0}] 1
# reason for two syntaxes: when passing {...block...} to fn
# and it wants to pass args
# it can do this by doing: fn $var 1 (1 is like in eval, tcl's uplevel)
call [fn {{x y} + $x $y}] 1 2
call [fn {x y} {+ $x $y}] 1 2