MACRO: smart-reduce ( reduce-quots -- quot )
unzip [ [ ] like ] bi@ dup length dup '[
- [ @ ] dip [ @ _ cleave-curry _ spread* ] each
+ _ dip [ @ _ cleave-curry _ spread* ] each
] ;
MACRO: smart-map-reduce ( map-reduce-quots -- quot )
MACRO: smart-2reduce ( 2reduce-quots -- quot )
unzip [ [ ] like ] bi@ dup length dup '[
- [ @ ] 2dip
+ _ 2dip
[ @ _ [ cleave-curry ] [ cleave-curry ] bi _ spread* ] 2each
] ;
M: ##horizontal-shr-vector-imm insn-available? rep>> %horizontal-shr-vector-imm-reps member? ;
: [vector-op-checked] ( #dup quot -- quot )
- '[ _ ndup [ @ ] { } make dup [ insn-available? ] all? ] ;
+ '[ _ ndup _ { } make dup [ insn-available? ] all? ] ;
GENERIC#: >vector-op-cond 2 ( quot #pick #dup -- quotpair )
M:: callable >vector-op-cond ( quot #pick #dup -- quotpair )
: change-insn-gc-roots ( gc-map-insn quot: ( x -- x ) -- )
[ gc-map>> ] dip [ swap gc-roots>> swap map! drop ]
- [ '[ [ [ @ ] bi@ ] assoc-map ] change-derived-roots drop ] 2bi ; inline
+ [ '[ [ _ bi@ ] assoc-map ] change-derived-roots drop ] 2bi ; inline
: spill-required? ( live-interval root-leaders n -- ? )
[ [ vreg>> ] dip sets:in? ] [ swap covers? ] bi-curry* bi or ;
\ at* [ at-quot ] 1 define-partial-eval
: diff-quot ( seq -- quot: ( seq' -- seq'' ) )
- [ tester ] keep '[ members [ @ ] reject _ set-like ] ;
+ [ tester ] keep '[ members _ reject _ set-like ] ;
M\ sets:set diff [ diff-quot ] 1 define-partial-eval
: (bignum-log) ( n log-quot: ( x -- y ) log-2 -- log )
[ dup ] dip '[
dup representable-as-float?
- [ >float @ ] [ frexp [ @ ] [ _ * ] bi* + ] if
+ [ >float @ ] [ frexp _ [ _ * ] bi* + ] if
] call ; inline
PRIVATE>
[ length ] keep [ <array> ] with { } map-as ;
: make-matrix-with-indices ( m n quot -- matrix )
- [ [ <iota> ] bi@ ] dip '[ @ ] cartesian-map ; inline
+ [ [ <iota> ] bi@ ] dip cartesian-map ; inline
: null-matrix? ( matrix -- ? ) empty? ; inline
MACRO: unpack ( str -- quot )
expand-pack-format
[ [ ch>packed-length ] { } map-as start/end ]
- [ [ unpack-table at '[ @ ] ] { } map-as ] bi
+ [ [ unpack-table at ] { } map-as ] bi
[ '[ [ _ _ ] dip <slice> @ ] ] 3map
'[ [ _ cleave ] output>array ] ;
GENERIC: known>callable ( known -- quot )
: ?@ ( x -- y )
- dup callable? [ drop [ @ ] ] unless ;
+ dup callable? [ drop _ ] unless ;
M: object known>callable drop \ _ ;
MACRO: inline-changer ( name -- quot' )
[ ">>" append ] [ ">>" prepend ] bi
[ "accessors" lookup-word 1quotation ] bi@
- '[ over [ [ @ ] dip call ] dip swap @ ] ;
+ '[ over [ _ dip call ] dip swap @ ] ;
SYNTAX: change: scan-token '[ _ inline-changer ] append! ;
<PRIVATE
: each-numbered-line ( ... quot: ( ... line number -- ... ) -- ... )
- [ 1 ] dip '[ swap [ @ ] [ 1 + ] bi ] each-line drop ; inline
+ [ 1 ] dip '[ swap _ [ 1 + ] bi ] each-line drop ; inline
PRIVATE>
! Helper to iterate over all entries of a list.
: udev_list_entry_foreach ( ... first_entry quot: ( ... x -- ... ) -- ... )
- [ [ dup ] ] dip '[ [ @ ] keep udev_list_entry_get_next ]
+ [ [ dup ] ] dip '[ _ keep udev_list_entry_get_next ]
while drop ; inline
! Get all list entries _as_ a list
: (write-message) ( message quot -- )
[ connection-buffer dup ] 2dip
'[
- [ _ [ write-header ] [ @ ] bi ] with-length-prefix
+ [ _ [ write-header ] _ bi ] with-length-prefix
] with-output-stream* write flush ; inline
:: build-query-object ( query -- selector )
: until-eof-reader ( reader-quot -- reader-quot' )
'[
- [ [ @ ] throw-on-eof ] [
+ [ _ throw-on-eof ] [
dup stream-exhausted? [ drop f ] [ throw ] if
] recover
] ; inline