using when instead of [ ] if.
parent
9d3b5cb44b
commit
d63c992d97
|
@ -266,8 +266,7 @@ M:: aes-decrypt (expand-key) ( K Nr -- sched )
|
||||||
K Nr (expand-enc-key) dup length :> key-length
|
K Nr (expand-enc-key) dup length :> key-length
|
||||||
[
|
[
|
||||||
[ 4 >= ] [ key-length 4 - < ] bi and
|
[ 4 >= ] [ key-length 4 - < ] bi and
|
||||||
[ subword ui32-rev> d-transform ]
|
[ subword ui32-rev> d-transform ] when
|
||||||
[ ] if
|
|
||||||
] map-index ;
|
] map-index ;
|
||||||
|
|
||||||
M: aes-decrypt (first-round) ( aes -- aes' )
|
M: aes-decrypt (first-round) ( aes -- aes' )
|
||||||
|
|
|
@ -102,7 +102,7 @@ TUPLE: vbo
|
||||||
B{ 0 0 0 } >>bitmap ;
|
B{ 0 0 0 } >>bitmap ;
|
||||||
|
|
||||||
: make-texture ( pathname alt -- texture )
|
: make-texture ( pathname alt -- texture )
|
||||||
swap [ nip load-image ] [ ] if*
|
swap [ nip load-image ] when*
|
||||||
[
|
[
|
||||||
[ component-order>> ]
|
[ component-order>> ]
|
||||||
[ component-type>> ] bi
|
[ component-type>> ] bi
|
||||||
|
|
|
@ -114,7 +114,7 @@ CONSTRUCTOR: <mdb-connection> mdb-connection ( instance -- mdb-connection ) ;
|
||||||
: eval-ismaster-result ( node result -- )
|
: eval-ismaster-result ( node result -- )
|
||||||
[
|
[
|
||||||
[ "ismaster" ] dip at dup string?
|
[ "ismaster" ] dip at dup string?
|
||||||
[ >integer 1 = ] [ ] if >>master? drop
|
[ >integer 1 = ] when >>master? drop
|
||||||
] [
|
] [
|
||||||
[ "remote" ] dip at
|
[ "remote" ] dip at
|
||||||
[ split-host-str <inet> f <mdb-node> >>remote ] when* drop
|
[ split-host-str <inet> f <mdb-node> >>remote ] when* drop
|
||||||
|
|
|
@ -104,8 +104,6 @@ M: tuple tuple>selector ( tuple -- assoc )
|
||||||
prepare-assoc [ tuple>selector ] write-tuple-fields ;
|
prepare-assoc [ tuple>selector ] write-tuple-fields ;
|
||||||
|
|
||||||
: assoc>tuple ( assoc -- tuple )
|
: assoc>tuple ( assoc -- tuple )
|
||||||
dup assoc?
|
dup assoc? [
|
||||||
[ [ dup tuple-info?
|
[ dup tuple-info? [ make-tuple ] when ] ignore-errors
|
||||||
[ make-tuple ]
|
] when ; inline recursive
|
||||||
[ ] if ] [ drop ] recover
|
|
||||||
] [ ] if ; inline recursive
|
|
||||||
|
|
|
@ -6,8 +6,7 @@ webbrowser ;
|
||||||
IN: oauth2
|
IN: oauth2
|
||||||
|
|
||||||
: console-prompt ( query -- str/f )
|
: console-prompt ( query -- str/f )
|
||||||
write flush readln [ blank? ] trim
|
write flush readln [ blank? ] trim [ f ] when-empty ;
|
||||||
dup "" = [ drop f ] [ ] if ;
|
|
||||||
|
|
||||||
: post-json-request ( params token-uri -- assoc )
|
: post-json-request ( params token-uri -- assoc )
|
||||||
<post-request> dup header>> "application/json" "Accept" rot set-at
|
<post-request> dup header>> "application/json" "Accept" rot set-at
|
||||||
|
|
|
@ -13,8 +13,9 @@ TUPLE: readline-reader { prompt initial: f } ;
|
||||||
INSTANCE: readline-reader input-stream
|
INSTANCE: readline-reader input-stream
|
||||||
|
|
||||||
M: readline-reader stream-readln
|
M: readline-reader stream-readln
|
||||||
flush [ prompt>> dup [ " " append ] [ ] if readline ]
|
flush
|
||||||
keep f >>prompt drop ;
|
[ dup [ " " append ] when readline f ] change-prompt
|
||||||
|
drop ;
|
||||||
|
|
||||||
M: readline-reader prompt.
|
M: readline-reader prompt.
|
||||||
>>prompt drop ;
|
>>prompt drop ;
|
||||||
|
|
Loading…
Reference in New Issue