2005-01-29 14:18:28 -05:00
|
|
|
! Copyright (C) 2004, 2005 Slava Pestov.
|
|
|
|
! See http://factor.sf.net/license.txt for BSD license.
|
2004-12-18 23:35:43 -05:00
|
|
|
IN: kernel
|
|
|
|
|
|
|
|
: 2drop ( x x -- ) drop drop ; inline
|
|
|
|
: 3drop ( x x x -- ) drop drop drop ; inline
|
|
|
|
: 2dup ( x y -- x y x y ) over over ; inline
|
|
|
|
: 3dup ( x y z -- x y z x y z ) pick pick pick ; inline
|
|
|
|
: rot ( x y z -- y z x ) >r swap r> swap ; inline
|
|
|
|
: -rot ( x y z -- z x y ) swap >r swap r> ; inline
|
|
|
|
: dupd ( x y -- x x y ) >r dup r> ; inline
|
|
|
|
: swapd ( x y z -- y x z ) >r swap r> ; inline
|
2005-02-01 20:14:03 -05:00
|
|
|
: 2swap ( x y z t -- z t x y ) rot >r rot r> ; inline
|
2004-12-18 23:35:43 -05:00
|
|
|
: nip ( x y -- y ) swap drop ; inline
|
2005-01-19 21:01:47 -05:00
|
|
|
: 2nip ( x y z -- z ) >r drop drop r> ; inline
|
2004-12-18 23:35:43 -05:00
|
|
|
: tuck ( x y -- y x y ) dup >r swap r> ; inline
|
|
|
|
|
|
|
|
: clear ( -- )
|
|
|
|
#! Clear the datastack. For interactive use only; invoking
|
|
|
|
#! this from a word definition will clobber any values left
|
|
|
|
#! on the data stack by the caller.
|
|
|
|
{ } set-datastack ;
|