Cleaning up some usages of -roll
parent
838bdb9438
commit
776b245c39
|
@ -199,8 +199,8 @@ M: long-long-type box-return ( type -- )
|
|||
zero? not ;
|
||||
|
||||
: >c-array ( seq type word -- )
|
||||
>r >r dup length dup r> <c-array> dup -roll r>
|
||||
[ execute ] 2curry 2each ; inline
|
||||
[ [ dup length ] dip <c-array> ] dip
|
||||
[ [ execute ] 2curry each-index ] 2keep drop ; inline
|
||||
|
||||
: >c-array-quot ( type vocab -- quot )
|
||||
dupd set-nth-word [ >c-array ] 2curry ;
|
||||
|
|
|
@ -64,8 +64,7 @@ DEFER: if
|
|||
|
||||
: 2keep ( x y quot -- x y ) 2over 2slip ; inline
|
||||
|
||||
: 3keep ( x y z quot -- x y z )
|
||||
>r 3dup r> -roll 3slip ; inline
|
||||
: 3keep ( x y z quot -- x y z ) >r 3dup r> -roll 3slip ; inline
|
||||
|
||||
! Cleavers
|
||||
: bi ( x p q -- )
|
||||
|
|
|
@ -37,7 +37,8 @@ FUNCTION: int execve ( char* path, char** argv, char** envp ) ;
|
|||
>r [ first ] [ ] bi r> exec-with-env ;
|
||||
|
||||
: with-fork ( child parent -- )
|
||||
fork-process dup zero? -roll swap curry if ; inline
|
||||
[ [ fork-process dup zero? ] dip [ drop ] prepose ] dip
|
||||
if ; inline
|
||||
|
||||
: SIGKILL 9 ; inline
|
||||
: SIGTERM 15 ; inline
|
||||
|
|
Loading…
Reference in New Issue