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" ; drop "Superfluous items pushed to data stack" ;
: assert-depth ( quot -- ) : assert-depth ( quot -- )
>r datastack r> swap slip >r datastack r> >r datastack r> dip >r datastack r>
2dup [ length ] compare { 2dup [ length ] compare {
{ +lt+ [ trim-datastacks nip relative-underflow ] } { +lt+ [ trim-datastacks nip relative-underflow ] }
{ +eq+ [ 2drop ] } { +eq+ [ 2drop ] }

View File

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

View File

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

View File

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

View File

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

View File

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