: check-return ( word label -- )
2dup
- [ stack-effect effect-height ]
+ [ stack-height ]
[ entry-stack-height current-stack-height swap - ]
bi*
= [ 2drop ] [
] H{ } make-assoc ;
: update-gestures ( class -- )
- dup command-gestures "gestures" set-word-prop ;
+ dup command-gestures set-gestures ;
: define-command-map ( class group blurb pairs -- )
<command-map>
M: word command-word ;
-M: f invoke-command ( target command -- ) 2drop ;
\ No newline at end of file
+M: f invoke-command ( target command -- ) 2drop ;
: round-dims ( seq -- newseq )
[ { 0 0 } ] dip
- [ swap v- dup [ ceiling ] map [ swap v- ] keep ] map
+ [ swap v- dup vceiling [ swap v- ] keep ] map
nip ;
PRIVATE>
tri ;
: <polygon-gadget> ( color points -- gadget )
- [ <polygon> ] [ { 0 0 } [ vmax ] reduce ] bi
+ [ <polygon> ] [ max-dim ] bi
[ <gadget> ] 2dip [ >>interior ] [ >>dim ] bi* ;
: show-links-popup ( browser-gadget quot title -- )
[ dup model>> ] 2dip <links-popup>
- [ hand-loc get { 0 0 } <rect> show-glass ] [ request-focus ] bi ; inline
+ [ hand-loc get point>rect show-glass ] [ request-focus ] bi ; inline
: com-show-outgoing-links ( browser-gadget -- )
[ uses ] "Outgoing links" show-links-popup ;
call( -- ) notify-ui-thread start-ui-thread ;
: ?attributes ( gadget title/attributes -- attributes )
- dup string? [ world-attributes new swap >>title ] [ clone ] if
+ dup string? [ <world-attributes> swap >>title ] [ clone ] if
swap [ [ [ 1array ] [ f ] if* ] curry unless* ] curry change-gadgets ;
PRIVATE>
[ in>> clone ] [ out>> clone ] bi <effect> ;
: stack-height ( word -- n )
- stack-effect effect-height ;
+ stack-effect effect-height ; inline
: shuffle-mapping ( effect -- mapping )
[ out>> ] [ in>> ] bi [ index ] curry map ;
: prefix ( seq elt -- newseq )
over [ over length 1 + ] dip [
- [ 0 swap set-nth-unsafe ] keep
- [ 1 swap copy ] keep
+ (1sequence) [ 1 swap copy ] keep
] new-like ;
: suffix ( seq elt -- newseq )
: dispatch-test ( -- )
1000000 sequences
- [ [ 0 swap nth don't-flush-me ] each ] curry times ;
+ [ [ first don't-flush-me ] each ] curry times ;
MAIN: dispatch-test
1 - lines>bytes number>string %
] "" make ;
-: etag-length ( vector -- n )
- 0 [ length + ] reduce ;
-
: (etag-header) ( n path -- str )
[
%
[ first file>lines ]
[ second ] bi
[ etag ] with map
- dup etag-length
- ] keep first
+ dup sum-lengths
+ ] keep first
etag-header append
] each ;