fix usages of cond/case

db4
Doug Coleman 2008-04-11 12:54:33 -05:00
parent f61d5a52d1
commit 1e01d73e61
12 changed files with 16 additions and 16 deletions

View File

@ -55,7 +55,7 @@ C: <button-paint> button-paint
{ [ dup button-pressed? ] [ drop button-paint-pressed ] } { [ dup button-pressed? ] [ drop button-paint-pressed ] }
{ [ dup button-selected? ] [ drop button-paint-selected ] } { [ dup button-selected? ] [ drop button-paint-selected ] }
{ [ dup button-rollover? ] [ drop button-paint-rollover ] } { [ dup button-rollover? ] [ drop button-paint-rollover ] }
{ [ t ] [ drop button-paint-plain ] } [ drop button-paint-plain ]
} cond ; } cond ;
M: button-paint draw-interior M: button-paint draw-interior

View File

@ -378,7 +378,7 @@ SYMBOL: in-layout?
{ {
{ [ 2dup eq? ] [ 2drop t ] } { [ 2dup eq? ] [ 2drop t ] }
{ [ dup not ] [ 2drop f ] } { [ dup not ] [ 2drop f ] }
{ [ t ] [ gadget-parent child? ] } [ gadget-parent child? ]
} cond ; } cond ;
GENERIC: focusable-child* ( gadget -- child/t ) GENERIC: focusable-child* ( gadget -- child/t )

View File

@ -88,7 +88,7 @@ C: <pane-stream> pane-stream
dup gadget-children { dup gadget-children {
{ [ dup empty? ] [ 2drop "" <label> ] } { [ dup empty? ] [ 2drop "" <label> ] }
{ [ dup length 1 = ] [ nip first ] } { [ dup length 1 = ] [ nip first ] }
{ [ t ] [ drop ] } [ drop ]
} cond ; } cond ;
: smash-pane ( pane -- gadget ) pane-output smash-line ; : smash-pane ( pane -- gadget ) pane-output smash-line ;

View File

@ -119,7 +119,7 @@ scroller H{
{ [ dup t eq? ] [ drop (scroll>bottom) ] } { [ dup t eq? ] [ drop (scroll>bottom) ] }
{ [ dup rect? ] [ swap (scroll>rect) ] } { [ dup rect? ] [ swap (scroll>rect) ] }
{ [ dup ] [ swap (scroll>gadget) ] } { [ dup ] [ swap (scroll>gadget) ] }
{ [ t ] [ drop dup scroller-value swap scroll ] } [ drop dup scroller-value swap scroll ]
} cond ; } cond ;
M: scroller layout* M: scroller layout*

View File

@ -191,7 +191,7 @@ SYMBOL: drag-timer
{ [ multi-click-button? not ] [ f ] } { [ multi-click-button? not ] [ f ] }
{ [ multi-click-position? not ] [ f ] } { [ multi-click-position? not ] [ f ] }
{ [ multi-click-position? not ] [ f ] } { [ multi-click-position? not ] [ f ] }
{ [ t ] [ t ] } [ t ]
} cond nip ; } cond nip ;
: update-click# ( button -- ) : update-click# ( button -- )

View File

@ -80,7 +80,7 @@ DEFER: draw-gadget
{ {
{ [ dup gadget-visible? not ] [ drop ] } { [ dup gadget-visible? not ] [ drop ] }
{ [ dup gadget-clipped? not ] [ (draw-gadget) ] } { [ dup gadget-clipped? not ] [ (draw-gadget) ] }
{ [ t ] [ [ (draw-gadget) ] with-clipping ] } [ [ (draw-gadget) ] with-clipping ]
} cond ; } cond ;
! Pen paint properties ! Pen paint properties

View File

@ -145,17 +145,17 @@ M: interactor stream-read-partial
tuck try-parse { tuck try-parse {
{ [ dup quotation? ] [ nip t ] } { [ dup quotation? ] [ nip t ] }
{ [ dup not ] [ drop "\n" swap user-input f f ] } { [ dup not ] [ drop "\n" swap user-input f f ] }
{ [ t ] [ handle-parse-error f f ] } [ handle-parse-error f f ]
} cond ; } cond ;
M: interactor stream-read-quot M: interactor stream-read-quot
[ interactor-yield ] keep { [ interactor-yield ] keep {
{ [ over not ] [ drop ] } { [ over not ] [ drop ] }
{ [ over callable? ] [ drop ] } { [ over callable? ] [ drop ] }
{ [ t ] [ [
[ handle-interactive ] keep swap [ handle-interactive ] keep swap
[ interactor-finish ] [ nip stream-read-quot ] if [ interactor-finish ] [ nip stream-read-quot ] if
] } ]
} cond ; } cond ;
M: interactor pref-dim* M: interactor pref-dim*

View File

@ -119,7 +119,7 @@ M: tuple-dispatch-engine-word word-completion-string
{ {
{ [ dup not ] [ 2drop ] } { [ dup not ] [ 2drop ] }
{ [ 2dup memq? ] [ 2drop ] } { [ 2dup memq? ] [ 2drop ] }
{ [ t ] [ push ] } [ push ]
} cond ; } cond ;
: insert-word ( word -- ) : insert-word ( word -- )

View File

@ -81,7 +81,7 @@ walker-gadget "toolbar" f {
{ {
{ [ dup walker-gadget? not ] [ 2drop f ] } { [ dup walker-gadget? not ] [ 2drop f ] }
{ [ dup walker-gadget-closing? ] [ 2drop f ] } { [ dup walker-gadget-closing? ] [ 2drop f ] }
{ [ t ] [ walker-gadget-thread eq? ] } [ walker-gadget-thread eq? ]
} cond ; } cond ;
: find-walker-window ( thread -- world/f ) : find-walker-window ( thread -- world/f )

View File

@ -70,7 +70,7 @@ DEFER: (gadget-subtree)
{ [ pick empty? ] [ rot drop traverse-to-path ] } { [ pick empty? ] [ rot drop traverse-to-path ] }
{ [ over empty? ] [ nip traverse-from-path ] } { [ over empty? ] [ nip traverse-from-path ] }
{ [ pick first pick first = ] [ traverse-child ] } { [ pick first pick first = ] [ traverse-child ] }
{ [ t ] [ traverse-middle ] } [ traverse-middle ]
} cond ; } cond ;
: gadget-subtree ( frompath topath gadget -- seq ) : gadget-subtree ( frompath topath gadget -- seq )

View File

@ -381,11 +381,11 @@ SYMBOL: trace-messages?
{ [ windows get empty? ] [ drop ] } { [ windows get empty? ] [ drop ] }
{ [ dup peek-message? ] [ ui-wait event-loop ] } { [ dup peek-message? ] [ ui-wait event-loop ] }
{ [ dup MSG-message WM_QUIT = ] [ drop ] } { [ dup MSG-message WM_QUIT = ] [ drop ] }
{ [ t ] [ [
dup TranslateMessage drop dup TranslateMessage drop
dup DispatchMessage drop dup DispatchMessage drop
event-loop event-loop
] } ]
} cond ; } cond ;
: register-wndclassex ( -- class ) : register-wndclassex ( -- class )

View File

@ -133,7 +133,7 @@ M: world selection-notify-event
{ {
{ [ dup XA_PRIMARY = ] [ drop selection get ] } { [ dup XA_PRIMARY = ] [ drop selection get ] }
{ [ dup XA_CLIPBOARD = ] [ drop clipboard get ] } { [ dup XA_CLIPBOARD = ] [ drop clipboard get ] }
{ [ t ] [ drop <clipboard> ] } [ drop <clipboard> ]
} cond ; } cond ;
: encode-clipboard ( string type -- bytes ) : encode-clipboard ( string type -- bytes )
@ -156,7 +156,7 @@ M: world selection-request-event
{ [ dup supported-type? ] [ drop dup set-selection-prop send-notify-success ] } { [ dup supported-type? ] [ drop dup set-selection-prop send-notify-success ] }
{ [ dup "TARGETS" x-atom = ] [ drop dup set-targets-prop send-notify-success ] } { [ dup "TARGETS" x-atom = ] [ drop dup set-targets-prop send-notify-success ] }
{ [ dup "TIMESTAMP" x-atom = ] [ drop dup set-timestamp-prop send-notify-success ] } { [ dup "TIMESTAMP" x-atom = ] [ drop dup set-timestamp-prop send-notify-success ] }
{ [ t ] [ drop send-notify-failure ] } [ drop send-notify-failure ]
} cond ; } cond ;
M: x11-ui-backend (close-window) ( handle -- ) M: x11-ui-backend (close-window) ( handle -- )