Skip to content

Commit

Permalink
basis/extra: removing '[ @ ] in favor of _ for fried quotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Jan 20, 2018
1 parent dcb06f3 commit b40ba26
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions basis/combinators/smart/smart.factor
Expand Up @@ -139,7 +139,7 @@ MACRO: map-reduce-outputs ( quot mapper reducer -- quot )

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 )
Expand All @@ -151,7 +151,7 @@ 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
] ;

Expand Down
2 changes: 1 addition & 1 deletion basis/compiler/cfg/intrinsics/simd/backend/backend.factor
Expand Up @@ -70,7 +70,7 @@ M: ##horizontal-shl-vector-imm insn-available? rep>> %horizontal-shl-vector-imm-
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 )
Expand Down
Expand Up @@ -103,7 +103,7 @@ RENAMING: assign [ vreg>reg ] [ vreg>reg ] [ vreg>reg ]

: 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 ;
Expand Down
Expand Up @@ -300,7 +300,7 @@ CONSTANT: lookup-table-at-max 256
\ 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

Expand Down
2 changes: 1 addition & 1 deletion basis/math/functions/functions.factor
Expand Up @@ -214,7 +214,7 @@ CONSTANT: log10-2 0x1.34413509f79ffp-2
: (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>
Expand Down
2 changes: 1 addition & 1 deletion basis/math/matrices/matrices.factor
Expand Up @@ -237,7 +237,7 @@ M: sequence square-cols
[ 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

Expand Down
2 changes: 1 addition & 1 deletion basis/pack/pack.factor
Expand Up @@ -123,7 +123,7 @@ PRIVATE>
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 ] ;

Expand Down
2 changes: 1 addition & 1 deletion basis/stack-checker/values/values.factor
Expand Up @@ -122,7 +122,7 @@ M: f (literal) current-word get bad-macro-input ;
GENERIC: known>callable ( known -- quot )

: ?@ ( x -- y )
dup callable? [ drop [ @ ] ] unless ;
dup callable? [ drop _ ] unless ;

M: object known>callable drop \ _ ;

Expand Down
2 changes: 1 addition & 1 deletion extra/changer/changer.factor
Expand Up @@ -6,6 +6,6 @@ IN: changer
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! ;
2 changes: 1 addition & 1 deletion extra/io/random/random.factor
Expand Up @@ -9,7 +9,7 @@ IN: io.random
<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>

Expand Down
2 changes: 1 addition & 1 deletion extra/libudev/libudev.factor
Expand Up @@ -95,7 +95,7 @@ FUNCTION: c-string udev_list_entry_get_value (

! 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
Expand Down
2 changes: 1 addition & 1 deletion extra/mongodb/operations/operations.factor
Expand Up @@ -84,7 +84,7 @@ PRIVATE>
: (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 )
Expand Down
2 changes: 1 addition & 1 deletion extra/tools/image-analyzer/utils/utils.factor
Expand Up @@ -23,7 +23,7 @@ IN: tools.image-analyzer.utils

: until-eof-reader ( reader-quot -- reader-quot' )
'[
[ [ @ ] throw-on-eof ] [
[ _ throw-on-eof ] [
dup stream-exhausted? [ drop f ] [ throw ] if
] recover
] ; inline
Expand Down

0 comments on commit b40ba26

Please sign in to comment.