Little cleanups

db4
Slava Pestov 2008-05-22 15:45:30 -05:00
parent 7ca15dcc68
commit 56852d3ab8
6 changed files with 10 additions and 10 deletions

View File

@ -93,7 +93,7 @@ M: relative-overflow summary
drop "Superfluous items pushed to data stack" ;
: assert-depth ( quot -- )
>r datastack r> swap slip >r datastack r>
>r datastack r> dip >r datastack r>
2dup [ length ] compare {
{ +lt+ [ trim-datastacks nip relative-underflow ] }
{ +eq+ [ 2drop ] }

View File

@ -57,6 +57,8 @@ DEFER: if
: dip ( obj quot -- obj ) swap slip ; inline
: 2dip ( obj1 obj2 quot -- obj1 obj2 ) -rot 2slip ; inline
! Keepers
: keep ( x quot -- x ) over slip ; inline
@ -88,14 +90,14 @@ DEFER: if
! Spreaders
: bi* ( x y p q -- )
>r swap slip r> call ; inline
>r dip r> call ; inline
: tri* ( x y z p q r -- )
>r rot >r bi* r> r> call ; inline
! Double spreaders
: 2bi* ( w x y z p q -- )
>r -rot 2slip r> call ; inline
>r 2dip r> call ; inline
! Appliers
: bi@ ( x y quot -- )

View File

@ -58,7 +58,7 @@ M: mailbox dispose* threads>> notify-all ;
: while-mailbox-empty ( mailbox quot -- )
over mailbox-empty? [
dup >r swap slip r> while-mailbox-empty
dup >r dip r> while-mailbox-empty
] [
2drop
] if ; inline

View File

@ -5,8 +5,6 @@ USING: kernel sequences namespaces math inference.transforms
IN: shuffle
: 2dip -rot 2slip ; inline
MACRO: npick ( n -- ) 1- dup saver [ dup ] rot [ r> swap ] n*quot 3append ;
MACRO: ndup ( n -- ) dup [ npick ] curry n*quot ;

View File

@ -10,7 +10,7 @@ IN: tools.test.ui
<dlist> \ graft-queue [
over
graft notify-queued
swap slip
dip
ungraft notify-queued
] with-variable
] with-string-writer print ;

View File

@ -64,14 +64,14 @@ annotation "ANNOTATION"
] unless ;
: <annotation-form> ( -- form )
"paste" <form>
"annotation" <form>
"annotation" pastebin-template >>view-template
"id" <integer>
hidden >>renderer
add-field
"aid" <integer>
hidden >>renderer
add-field
"annotation" pastebin-template >>view-template
"summary" <string> add-field
"author" <string> add-field
"mode" <mode> add-field
@ -79,7 +79,7 @@ annotation "ANNOTATION"
"date" <date> add-field ;
: <new-annotation-form> ( -- form )
"paste" <form>
"annotation" <form>
"new-annotation" pastebin-template >>edit-template
"id" <integer>
hidden >>renderer