Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (23 sloc) 645 Bytes
; Create the : word which is a shortcut for
; defining other word. Use : like this
; : <word> [ <<defintion>> ]
compile [ gettok compile rot set! ] ':' set!
: true [ 1 1 = ]
: false [ 1 0 = ]
; Print the top of the stack and pop it off
: . [ print drop ]
; Print a newline
: nl [ 10 char . ]
; Print the top of the stack followed by a newline
: .nl [ . nl ]
: space [ ' ' . ]
: .top [ print nl ]
: .lookup [ lookup . nl ]
: max [ dup lrot dup lrot rot > ifelse [ drop ] [ rot drop ] ]
: min [ dup lrot dup lrot rot < ifelse [ drop ] [ rot drop ] ]
: 0< [ 0 < ]
: 0= [ 0 = ]
: >0 [ 0 > ]
: 1+ [ 1 + ]
: 1- [ 1 - ]
: 2* [ 2 * ]