diff --git a/apps/hacker-news/hacker-news.factor b/apps/hacker-news/hacker-news.factor index c134428159..7ac345f24d 100644 --- a/apps/hacker-news/hacker-news.factor +++ b/apps/hacker-news/hacker-news.factor @@ -25,13 +25,13 @@ PRIVATE< [ hacker-news-recent-ids ] dip head hacker-news-items ; : write-title ( title url -- ) - '[ + $[ _ presented ,, ui-running? color: black color: white ? foreground ,, ] H{ } make format ; : write-link ( title url -- ) - '[ + $[ _ presented ,, hexcolor: 888888 foreground ,, ] H{ } make format ; diff --git a/apps/reddit/reddit.factor b/apps/reddit/reddit.factor index 6744a3a45c..d0fcc2e1c0 100644 --- a/apps/reddit/reddit.factor +++ b/apps/reddit/reddit.factor @@ -78,13 +78,13 @@ PRIVATE> PRIVATE< : write-title ( title url -- ) - '[ + $[ _ presented ,, color: blue foreground ,, ] H{ } make format ; : write-link ( title url -- ) - '[ + $[ _ presented ,, hexcolor: 888888 foreground ,, ] H{ } make format ; diff --git a/benchmarks/benchmark/benchmark.factor b/benchmarks/benchmark/benchmark.factor index 82cb9d255b..1ec34517f3 100644 --- a/benchmarks/benchmark/benchmark.factor +++ b/benchmarks/benchmark/benchmark.factor @@ -6,10 +6,10 @@ tools.profiler.sampling tools.test tools.time vocabs.hierarchy vocabs.loader ; IN: benchmark : run-timing-benchmark ( vocab -- time ) - 5 swap '[ gc [ _ run ] benchmark ] replicate infimum ; + 5 swap $[ gc [ _ run ] benchmark ] replicate infimum ; : run-profile-benchmark ( vocab -- profile ) - compact-gc '[ _ run ] profile most-recent-profile-data ; + compact-gc $[ _ run ] profile most-recent-profile-data ; : find-benchmark-vocabs ( -- seq ) "benchmark" disk-child-vocab-names [ find-vocab-root ] filter ; @@ -20,14 +20,14 @@ PRIVATE< "=== %s\n" printf ; : run-benchmark ( vocab quot: ( vocab -- res ) -- result ok? ) - over write-header '[ _ @ t ] [ + over write-header $[ _ @ t ] [ f f f f ] recover ; inline PRIVATE> : run-benchmarks ( benchmarks quot: ( vocab -- res ) -- results errors ) - '[ dup _ run-benchmark 3array ] map + $[ dup _ run-benchmark 3array ] map [ third ] partition [ [ 2 head ] map ] bi@ ; inline : run-profile-benchmarks ( -- results errors ) diff --git a/benchmarks/benchmark/chameneos-redux/chameneos-redux.factor b/benchmarks/benchmark/chameneos-redux/chameneos-redux.factor index bcc0e85620..270dbd5417 100644 --- a/benchmarks/benchmark/chameneos-redux/chameneos-redux.factor +++ b/benchmarks/benchmark/chameneos-redux/chameneos-redux.factor @@ -50,7 +50,7 @@ TUPLE: meeting-place count mailbox ; : print-color-table ( -- ) { blue red yellow } dup - '[ _ '[ color-string print ] with each ] each ; + $[ _ $[ color-string print ] with each ] each ; : try-meet ( meeting-place creature -- ) over count>> 0 < [ @@ -75,7 +75,7 @@ TUPLE: meeting-place count mailbox ; mailbox>> mailbox-get-all [ f swap mailbox>> mailbox-put ] each ] [ - [ mailbox>> 2 swap '[ _ mailbox-get ] replicate creature-meeting ] + [ mailbox>> 2 swap $[ _ mailbox-get ] replicate creature-meeting ] [ run-meeting-place ] bi ] if ; @@ -86,7 +86,7 @@ TUPLE: meeting-place count mailbox ; [ ] [ make-creatures ] bi* { [ nip nl bl [ bl ] [ color>> name>> write ] interleave nl ] - [ [ '[ _ _ try-meet ] in-thread ] with each ] + [ [ $[ _ _ try-meet ] in-thread ] with each ] [ drop run-meeting-place ] [ nip [ [ count>> number>string write bl ] [ self-count>> number>text write nl ] bi ] each ] diff --git a/benchmarks/benchmark/dawes/dawes.factor b/benchmarks/benchmark/dawes/dawes.factor index 839bd89dc0..3079640c2b 100644 --- a/benchmarks/benchmark/dawes/dawes.factor +++ b/benchmarks/benchmark/dawes/dawes.factor @@ -11,6 +11,6 @@ IN: benchmark.dawes 120000 iota [ 255 bitand ] int-array{ } map-as ; inline : dawes-benchmark ( -- ) - 200 make-int-array '[ _ count-ones ] replicate drop ; + 200 make-int-array $[ _ count-ones ] replicate drop ; MAIN: dawes-benchmark diff --git a/benchmarks/benchmark/dispatch2/dispatch2.factor b/benchmarks/benchmark/dispatch2/dispatch2.factor index c57fbdb998..fe41c9c6ee 100644 --- a/benchmarks/benchmark/dispatch2/dispatch2.factor +++ b/benchmarks/benchmark/dispatch2/dispatch2.factor @@ -23,10 +23,10 @@ IN: benchmark.dispatch2 1 [ + ] curry , ] { } make ; -: don't-flush-me ( obj -- ) drop ; +: dont-flush-me ( obj -- ) drop ; : dispatch2-benchmark ( -- ) 1000000 sequences - [ [ first don't-flush-me ] each ] curry times ; + [ [ first dont-flush-me ] each ] curry times ; MAIN: dispatch2-benchmark diff --git a/benchmarks/benchmark/fannkuch/fannkuch.factor b/benchmarks/benchmark/fannkuch/fannkuch.factor index 8e4176c9d5..2539e6d986 100644 --- a/benchmarks/benchmark/fannkuch/fannkuch.factor +++ b/benchmarks/benchmark/fannkuch/fannkuch.factor @@ -7,10 +7,10 @@ IN: benchmark.fannkuch : count ( quot: ( -- ? ) -- n ) ! Call quot until it returns false, return number of times ! it was true - [ 0 ] dip '[ _ dip swap [ [ 1 + ] when ] keep ] loop ; inline + [ 0 ] dip $[ _ dip swap [ [ 1 + ] when ] keep ] loop ; inline : count-flips ( perm -- flip# ) - '[ + $[ _ dup first dup 1 = [ 2drop f ] [ head-slice reverse! drop t ] if ] count ; inline diff --git a/benchmarks/benchmark/fasta/fasta.factor b/benchmarks/benchmark/fasta/fasta.factor index 683615ac5e..c62e66503e 100644 --- a/benchmarks/benchmark/fasta/fasta.factor +++ b/benchmarks/benchmark/fasta/fasta.factor @@ -53,7 +53,7 @@ TYPED: make-cumulative ( freq -- chars: byte-array floats: double-array ) seed next-fasta-random floats [ <= ] with find drop chars nth-unsafe ; inline TYPED: make-random-fasta ( seed: float len: fixnum chars: byte-array floats: double-array -- seed: float ) - '[ _ _ select-random ] "" replicate-as print ; + $[ _ _ select-random ] "" replicate-as print ; : write-description ( desc id -- ) ">" write write bl print ; @@ -65,7 +65,7 @@ TYPED: make-random-fasta ( seed: float len: fixnum chars: byte-array floats: dou TYPED: write-random-fasta ( seed: float n: fixnum chars: byte-array floats: double-array desc id -- seed: float ) write-description - '[ _ _ make-random-fasta ] split-lines ; + $[ _ _ make-random-fasta ] split-lines ; TYPED:: make-repeat-fasta ( k: fixnum len: fixnum alu: string -- k': fixnum ) alu length :> kn diff --git a/benchmarks/benchmark/gc3/gc3.factor b/benchmarks/benchmark/gc3/gc3.factor index a6fbefb78c..de1a756ae0 100644 --- a/benchmarks/benchmark/gc3/gc3.factor +++ b/benchmarks/benchmark/gc3/gc3.factor @@ -6,6 +6,6 @@ IN: benchmark.gc3 : gc3-benchmark ( -- ) 1000000 iota 1000000 - '[ [ number>string ] keep _ set-at ] each ; + $[ [ number>string ] keep _ set-at ] each ; MAIN: gc3-benchmark diff --git a/benchmarks/benchmark/hash-sets/hash-sets.factor b/benchmarks/benchmark/hash-sets/hash-sets.factor index ac655daaae..15ce4e7f24 100644 --- a/benchmarks/benchmark/hash-sets/hash-sets.factor +++ b/benchmarks/benchmark/hash-sets/hash-sets.factor @@ -10,7 +10,7 @@ CONSTANT: test-sets $$[ ] ; : do-times ( n quot: ( set1 set2 -- set' ) -- ) - '[ 2dup @ drop ] times 2drop ; inline + $[ 2dup @ drop ] times 2drop ; inline : bench-sets ( seq -- ) 2 [ diff --git a/benchmarks/benchmark/interval-sets/interval-sets.factor b/benchmarks/benchmark/interval-sets/interval-sets.factor index b8abb2d26b..4894ba4eb0 100644 --- a/benchmarks/benchmark/interval-sets/interval-sets.factor +++ b/benchmarks/benchmark/interval-sets/interval-sets.factor @@ -9,6 +9,6 @@ IN: benchmark.interval-sets : interval-sets-benchmark ( -- ) 10,000 [ random-32 ] replicate natural-sort 2 - 3,000,000 swap '[ random-32 _ in? drop ] times ; + 3,000,000 swap $[ random-32 _ in? drop ] times ; MAIN: interval-sets-benchmark diff --git a/benchmarks/benchmark/knucleotide/knucleotide.factor b/benchmarks/benchmark/knucleotide/knucleotide.factor index 510fadf841..3df463d1fe 100644 --- a/benchmarks/benchmark/knucleotide/knucleotide.factor +++ b/benchmarks/benchmark/knucleotide/knucleotide.factor @@ -20,7 +20,7 @@ CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt" ; : handle-table ( inputs n -- ) clump [ histogram sort-values reverse ] [ length ] bi - '[ + $[ [ first write bl ] [ second 100 * _ /f "%.3f" printf nl ] bi ] each ; diff --git a/benchmarks/benchmark/linked-assocs/linked-assocs.factor b/benchmarks/benchmark/linked-assocs/linked-assocs.factor index 4e4a38cf14..ce502e8e07 100644 --- a/benchmarks/benchmark/linked-assocs/linked-assocs.factor +++ b/benchmarks/benchmark/linked-assocs/linked-assocs.factor @@ -5,11 +5,11 @@ IN: benchmark.linked-assocs : (linked-assocs-benchmark) ( -- ) 10,000 iota { - [ '[ 0 swap _ set-at ] each ] - [ '[ _ at ] map-sum 0 assert= ] - [ '[ dup _ set-at ] each ] - [ '[ _ at ] map-sum 49995000 assert= ] - [ '[ _ delete-at ] each ] + [ $[ 0 swap _ set-at ] each ] + [ $[ _ at ] map-sum 0 assert= ] + [ $[ dup _ set-at ] each ] + [ $[ _ at ] map-sum 49995000 assert= ] + [ $[ _ delete-at ] each ] [ nip assoc-size 0 assert= ] } 2cleave ; diff --git a/benchmarks/benchmark/mandel/colors/colors.factor b/benchmarks/benchmark/mandel/colors/colors.factor index 4394f5d6b6..df197a756a 100644 --- a/benchmarks/benchmark/mandel/colors/colors.factor +++ b/benchmarks/benchmark/mandel/colors/colors.factor @@ -11,7 +11,7 @@ CONSTANT: sat 0.85 ; CONSTANT: val 0.85 ; : ( nb-cols -- map ) - [ iota ] keep '[ + [ iota ] keep $[ 360 * _ 1 + / sat val 1 >rgba scale-rgb ] map ; diff --git a/benchmarks/benchmark/mandel/mandel.factor b/benchmarks/benchmark/mandel/mandel.factor index f973411030..eeefc2c1f8 100644 --- a/benchmarks/benchmark/mandel/mandel.factor +++ b/benchmarks/benchmark/mandel/mandel.factor @@ -14,17 +14,17 @@ IN: benchmark.mandel : c ( i j -- c ) scale center width height scale 2 / - + ; inline : count-iterations ( z max-iterations step-quot test-quot -- #iters ) - '[ drop @ dup @ ] find-last-integer nip ; inline + $[ drop @ dup @ ] find-last-integer nip ; inline : pixel ( c -- iterations ) [ C{ 0.0 0.0 } max-iterations ] dip - '[ sq _ + ] [ absq 4.0 >= ] count-iterations ; inline + $[ sq _ + ] [ absq 4.0 >= ] count-iterations ; inline : color ( iterations -- color ) [ color-map [ length mod ] keep nth ] [ B{ 0 0 0 } ] if* ; inline : render ( -- ) - height iota [ width iota swap '[ _ c pixel color write ] each ] each ; inline + height iota [ width iota swap $[ _ c pixel color write ] each ] each ; inline : ppm-header ( -- ) ascii encode-output diff --git a/benchmarks/benchmark/mt/mt.factor b/benchmarks/benchmark/mt/mt.factor index 27cfe8c7d8..6b7129d5ff 100644 --- a/benchmarks/benchmark/mt/mt.factor +++ b/benchmarks/benchmark/mt/mt.factor @@ -4,7 +4,7 @@ USING: fry kernel math random random.mersenne-twister ; IN: benchmark.mt : mt-bench ( n -- ) - >fixnum 0x533d '[ _ random-32* drop ] times ; + >fixnum 0x533d $[ _ random-32* drop ] times ; : mt-benchmark ( -- ) 10000000 mt-bench ; diff --git a/benchmarks/benchmark/nbody-simd/nbody-simd.factor b/benchmarks/benchmark/nbody-simd/nbody-simd.factor index 5c3c563cb0..c1c2373e88 100644 --- a/benchmarks/benchmark/nbody-simd/nbody-simd.factor +++ b/benchmarks/benchmark/nbody-simd/nbody-simd.factor @@ -67,19 +67,19 @@ SPECIALIZED-ARRAY: body ] each-index ; inline : update-position ( body dt -- ) - [ dup velocity>> ] dip '[ _ _ v*n v+ ] change-location drop ; inline + [ dup velocity>> ] dip $[ _ _ v*n v+ ] change-location drop ; inline : mag ( dt body other-body -- mag d ) [ location>> ] bi@ v- [ norm-sq dup sqrt * / ] keep ; inline :: update-velocity ( other-body body dt -- ) dt body other-body mag - [ [ body ] 2dip '[ other-body mass>> _ * _ n*v v- ] change-velocity drop ] - [ [ other-body ] 2dip '[ body mass>> _ * _ n*v v+ ] change-velocity drop ] 2bi ; inline + [ [ body ] 2dip $[ other-body mass>> _ * _ n*v v- ] change-velocity drop ] + [ [ other-body ] 2dip $[ body mass>> _ * _ n*v v+ ] change-velocity drop ] 2bi ; inline : advance ( system dt -- ) - [ '[ _ update-velocity ] [ drop ] each-pair ] - [ '[ _ update-position ] each ] + [ $[ _ update-velocity ] [ drop ] each-pair ] + [ $[ _ update-position ] each ] 2bi ; inline : inertia ( body -- e ) @@ -95,7 +95,7 @@ SPECIALIZED-ARRAY: body >fixnum [ energy number>string print ] - [ '[ _ 0.01 advance ] times ] + [ $[ _ 0.01 advance ] times ] [ energy number>string print ] tri ; : nbody-simd-benchmark ( -- ) 1000000 nbody ; diff --git a/benchmarks/benchmark/nbody/nbody.factor b/benchmarks/benchmark/nbody/nbody.factor index 5896328ffb..60d503e1cb 100644 --- a/benchmarks/benchmark/nbody/nbody.factor +++ b/benchmarks/benchmark/nbody/nbody.factor @@ -67,20 +67,20 @@ TUPLE: nbody-system { bodies array read-only } ; ] each-index ; inline : update-position ( body dt -- ) - [ dup velocity>> ] dip '[ _ _ v*n v+ ] change-location drop ; + [ dup velocity>> ] dip $[ _ _ v*n v+ ] change-location drop ; : mag ( dt body other-body -- mag d ) [ location>> ] bi@ v- [ norm-sq dup sqrt * / ] keep ; inline :: update-velocity ( other-body body dt -- ) dt body other-body mag - [ [ body ] 2dip '[ other-body mass>> _ * _ n*v v- ] change-velocity drop ] - [ [ other-body ] 2dip '[ body mass>> _ * _ n*v v+ ] change-velocity drop ] 2bi ; + [ [ body ] 2dip $[ other-body mass>> _ * _ n*v v- ] change-velocity drop ] + [ [ other-body ] 2dip $[ body mass>> _ * _ n*v v+ ] change-velocity drop ] 2bi ; : advance ( system dt -- ) [ bodies>> ] dip - [ '[ _ update-velocity ] [ drop ] each-pair ] - [ '[ _ update-position ] each ] + [ $[ _ update-velocity ] [ drop ] each-pair ] + [ $[ _ update-position ] each ] 2bi ; inline : inertia ( body -- e ) @@ -94,7 +94,7 @@ TUPLE: nbody-system { bodies array read-only } ; : nbody ( n -- ) - [ energy . ] [ '[ _ 0.01 advance ] times ] [ energy . ] tri ; + [ energy . ] [ $[ _ 0.01 advance ] times ] [ energy . ] tri ; HINTS: update-position body float ; HINTS: update-velocity body body float ; diff --git a/benchmarks/benchmark/partial-sums/partial-sums.factor b/benchmarks/benchmark/partial-sums/partial-sums.factor index b32ce928a2..6761010e3c 100644 --- a/benchmarks/benchmark/partial-sums/partial-sums.factor +++ b/benchmarks/benchmark/partial-sums/partial-sums.factor @@ -5,8 +5,8 @@ combinators hints fry sequences ; IN: benchmark.partial-sums ! Helper words -: summing-integers ( n quot -- y ) [ 0.0 ] [ iota ] [ ] tri* '[ 1 + @ + ] each ; inline -: summing-floats ( n quot -- y ) '[ >float @ ] summing-integers ; inline +: summing-integers ( n quot -- y ) [ 0.0 ] [ iota ] [ ] tri* $[ 1 + @ + ] each ; inline +: summing-floats ( n quot -- y ) $[ >float @ ] summing-integers ; inline : cube ( x -- y ) dup dup * * ; inline : -1^ ( n -- -1/1 ) 2 mod 2 * 1 - ; inline diff --git a/benchmarks/benchmark/pidigits/pidigits.factor b/benchmarks/benchmark/pidigits/pidigits.factor index efcb3f3a1e..5e45205660 100644 --- a/benchmarks/benchmark/pidigits/pidigits.factor +++ b/benchmarks/benchmark/pidigits/pidigits.factor @@ -7,7 +7,7 @@ math.vectors prettyprint sequences sequences.deep ; IN: benchmark.pidigits : extract ( z x -- n ) - [ first2 ] dip '[ first2 [ _ * ] [ + ] bi* ] bi@ /i ; + [ first2 ] dip $[ first2 [ _ * ] [ + ] bi* ] bi@ /i ; : next ( z -- n ) 3 extract ; @@ -32,7 +32,7 @@ IN: benchmark.pidigits 10 col - number>string glue ; : padded-total ( row col -- ) - (padded-total) '[ _ printf ] call( str n -- ) ; + (padded-total) $[ _ printf ] call( str n -- ) ; :: (pidigits) ( k z n row col -- ) n 0 > [ diff --git a/benchmarks/benchmark/regexp/regexp.factor b/benchmarks/benchmark/regexp/regexp.factor index cea0aa8c88..161a2dc784 100644 --- a/benchmarks/benchmark/regexp/regexp.factor +++ b/benchmarks/benchmark/regexp/regexp.factor @@ -8,7 +8,7 @@ IN: benchmark.regexp 200 20,000 iota [ number>string ] map 200 iota [ 1 + char: a ] map - '[ + $[ _ R[[ \d+]] [ matches? ] curry all? t assert= _ R[[ [a]+]] [ matches? ] curry all? t assert= ] times ; diff --git a/benchmarks/benchmark/sfmt/sfmt.factor b/benchmarks/benchmark/sfmt/sfmt.factor index 85230a0aaa..d0df44e606 100644 --- a/benchmarks/benchmark/sfmt/sfmt.factor +++ b/benchmarks/benchmark/sfmt/sfmt.factor @@ -4,7 +4,7 @@ USING: fry kernel math random random.sfmt ; IN: benchmark.sfmt : sfmt-bench ( n -- ) - >fixnum 0x533d '[ _ random-32* drop ] times ; + >fixnum 0x533d $[ _ random-32* drop ] times ; : sfmt-benchmark ( -- ) 10000000 sfmt-bench ; diff --git a/benchmarks/benchmark/tcp-echo0/tcp-echo0.factor b/benchmarks/benchmark/tcp-echo0/tcp-echo0.factor index 11b77594af..237c4580d1 100644 --- a/benchmarks/benchmark/tcp-echo0/tcp-echo0.factor +++ b/benchmarks/benchmark/tcp-echo0/tcp-echo0.factor @@ -33,7 +33,7 @@ ERROR: incorrect-#bytes ; M: tcp-echo handle-client* [ #times>> ] [ #bytes>> ] bi - '[ _ [ _ test-bytes write-read ] times ] call ; + $[ _ [ _ test-bytes write-read ] times ] call ; : server>address ( server -- port ) servers>> first addr>> port>> local-server ; diff --git a/benchmarks/benchmark/udp-echo0/udp-echo0.factor b/benchmarks/benchmark/udp-echo0/udp-echo0.factor index df7755f61f..702c9be4bf 100644 --- a/benchmarks/benchmark/udp-echo0/udp-echo0.factor +++ b/benchmarks/benchmark/udp-echo0/udp-echo0.factor @@ -10,7 +10,7 @@ IN: benchmark.udp-echo0 [ 2dup addr>> ] [ send ] bi* receive drop assert= ; : udp-echo ( #times #bytes -- ) - '[ + $[ _ iota [ _ >be ] map "127.0.0.1" 0 &dispose "127.0.0.1" 0 &dispose diff --git a/collections/arrays/shaped/shaped.factor b/collections/arrays/shaped/shaped.factor index b5bf9f9cbe..037eccdcc7 100644 --- a/collections/arrays/shaped/shaped.factor +++ b/collections/arrays/shaped/shaped.factor @@ -217,10 +217,10 @@ ERROR: 2d-expected shaped ; ! [ ! [ underlying>> [ length iota ] keep zip ] ! [ ] bi - ! ] dip '[ _ [ _ set- ] @ ] assoc-each ; inline + ! ] dip $[ _ [ _ set- ] @ ] assoc-each ; inline : shaped-map! ( .. sa quot -- sa ) - '[ _ map ] change-underlying ; inline + $[ _ map ] change-underlying ; inline : shaped-map ( .. sa quot -- sa' ) [ [ underlying>> ] dip map ] @@ -228,7 +228,7 @@ ERROR: 2d-expected shaped ; : pad-shapes ( sa0 sa1 -- sa0' sa1' ) 2dup [ shape>> ] bi@ - 2dup longer length '[ _ 1 pad-head ] bi@ + 2dup longer length $[ _ 1 pad-head ] bi@ [ shaped-like ] bi-curry@ bi* ; : output-shape ( sa0 sa1 -- shape ) @@ -243,7 +243,7 @@ ERROR: 2d-expected shaped ; : broadcastable? ( sa0 sa1 -- ? ) pad-shapes [ [ shape>> ] bi@ ] [ output-shape ] 2bi - '[ _ broadcast-shape-matches? ] both? ; + $[ _ broadcast-shape-matches? ] both? ; TUPLE: block-array shaped shape ; @@ -266,32 +266,32 @@ TUPLE: block-array shaped shape ; : map-strict-lower ( shaped quot -- shaped ) [ check-2d ] dip - '[ first2 first2 > _ when ] map-shaped-index ; inline + $[ first2 first2 > _ when ] map-shaped-index ; inline : map-lower ( shaped quot -- shaped ) [ check-2d ] dip - '[ first2 first2 >= _ when ] map-shaped-index ; inline + $[ first2 first2 >= _ when ] map-shaped-index ; inline : map-strict-upper ( shaped quot -- shaped ) [ check-2d ] dip - '[ first2 first2 < _ when ] map-shaped-index ; inline + $[ first2 first2 < _ when ] map-shaped-index ; inline : map-upper ( shaped quot -- shaped ) [ check-2d ] dip - '[ first2 first2 <= _ when ] map-shaped-index ; inline + $[ first2 first2 <= _ when ] map-shaped-index ; inline : map-diagonal ( shaped quot -- shaped ) [ check-2d ] dip - '[ first2 first2 = _ when ] map-shaped-index ; inline + $[ first2 first2 = _ when ] map-shaped-index ; inline : upper ( shape obj -- shaped ) - [ zeros check-2d ] dip '[ drop _ ] map-upper ; + [ zeros check-2d ] dip $[ drop _ ] map-upper ; : strict-upper ( shape obj -- shaped ) - [ zeros check-2d ] dip '[ drop _ ] map-strict-upper ; + [ zeros check-2d ] dip $[ drop _ ] map-strict-upper ; : lower ( shape obj -- shaped ) - [ zeros check-2d ] dip '[ drop _ ] map-lower ; + [ zeros check-2d ] dip $[ drop _ ] map-lower ; : strict-lower ( shape obj -- shaped ) - [ zeros check-2d ] dip '[ drop _ ] map-strict-lower ; + [ zeros check-2d ] dip $[ drop _ ] map-strict-lower ; diff --git a/collections/bit-arrays/bit-arrays.factor b/collections/bit-arrays/bit-arrays.factor index 69503f9c73..28ec7bf88a 100644 --- a/collections/bit-arrays/bit-arrays.factor +++ b/collections/bit-arrays/bit-arrays.factor @@ -25,7 +25,7 @@ PRIVATE< : (set-bits) ( bit-array n -- ) [ [ length bits>cells ] keep ] dip swap underlying>> - '[ [ _ _ ] dip 4 * set-alien-unsigned-4 ] each-integer ; inline + $[ [ _ _ ] dip 4 * set-alien-unsigned-4 ] each-integer ; inline : zero-end-bits ( bit-array -- bit-array ) ! Zero bits after the end. diff --git a/collections/bit-sets/bit-sets.factor b/collections/bit-sets/bit-sets.factor index 88eec6fbca..b3401b0f72 100644 --- a/collections/bit-sets/bit-sets.factor +++ b/collections/bit-sets/bit-sets.factor @@ -60,7 +60,7 @@ M: bit-set subset? [ intersect ] keep = ; M: bit-set members - table>> [ length iota ] keep '[ _ nth-unsafe ] filter ; + table>> [ length iota ] keep $[ _ nth-unsafe ] filter ; PRIVATE< diff --git a/collections/bitstreams/bitstreams.factor b/collections/bitstreams/bitstreams.factor index 93fef44032..11051cfc42 100644 --- a/collections/bitstreams/bitstreams.factor +++ b/collections/bitstreams/bitstreams.factor @@ -182,6 +182,6 @@ M: msb0-bit-reader peek ( n bs -- bits ) :: byte-array-n>sequence ( byte-array n -- seq ) byte-array length 8 * n / iota - byte-array '[ + byte-array $[ drop n _ read ] { } map-as ; diff --git a/collections/bloom-filters/bloom-filters.factor b/collections/bloom-filters/bloom-filters.factor index 8347a269f2..7e825c9930 100644 --- a/collections/bloom-filters/bloom-filters.factor +++ b/collections/bloom-filters/bloom-filters.factor @@ -84,7 +84,7 @@ PRIVATE< ! tradeoff to support it, and I haven't done my own, but we'll ! go with it anyway. : size-bloom-filter ( error-rate number-objects -- number-hashes number-bits ) - [ #hashes-range identity-configuration ] 2dip '[ + [ #hashes-range identity-configuration ] 2dip $[ dup _ _ bits-to-satisfy-error-rate 2array smaller-second ] reduce check-hashes first2 ; @@ -127,7 +127,7 @@ PRIVATE< : relevant-indices ( object bloom-filter -- n quot: ( elt -- n ) ) [ double-hashcodes ] [ #hashes-and-length ] bi* - [ -rot ] dip '[ _ _ combine-hashcodes _ mod ] ; inline + [ -rot ] dip $[ _ _ combine-hashcodes _ mod ] ; inline PRIVATE> diff --git a/collections/cache/cache.factor b/collections/cache/cache.factor index 1e717bff7f..5d227b89b1 100755 --- a/collections/cache/cache.factor +++ b/collections/cache/cache.factor @@ -39,7 +39,7 @@ PRIVATE> : purge-cache ( cache -- ) [ assoc>> ] [ max-age>> ] bi V{ } clone [ - '[ + $[ nip dup age>> 1 + [ >>age ] keep _ < [ drop t ] [ _ dispose-to f ] if ] assoc-filter! drop diff --git a/collections/circular/circular.factor b/collections/circular/circular.factor index d825d4e5c2..e79c2d98da 100644 --- a/collections/circular/circular.factor +++ b/collections/circular/circular.factor @@ -79,4 +79,4 @@ PRIVATE> [ clone ] dip [ ] dip (circular-while) ; inline : circular-loop ( ... circular quot: ( ... obj -- ... ? ) -- ... ) - [ clone ] dip '[ [ first @ ] [ rotate-circular ] bi ] curry loop ; inline + [ clone ] dip $[ [ first @ ] [ rotate-circular ] bi ] curry loop ; inline diff --git a/collections/cursors/cursors.factor b/collections/cursors/cursors.factor index eda2e0ad3a..5cc0888f56 100644 --- a/collections/cursors/cursors.factor +++ b/collections/cursors/cursors.factor @@ -132,17 +132,17 @@ M: end-of-stream cursor-stream-ended? drop t ; inline ! : -each ( ... begin end quot: ( ... cursor -- ... ) -- ... ) - [ '[ dup _ cursor>= ] ] - [ '[ _ keep inc-cursor ] ] bi* until drop ; inline + [ $[ dup _ cursor>= ] ] + [ $[ _ keep inc-cursor ] ] bi* until drop ; inline : -find ( ... begin end quot: ( ... cursor -- ... ? ) -- ... cursor ) - '[ dup _ cursor>= [ t ] [ dup @ ] if ] [ inc-cursor ] until ; inline + $[ dup _ cursor>= [ t ] [ dup @ ] if ] [ inc-cursor ] until ; inline : -in- ( quot -- quot' ) - '[ cursor-value-unsafe @ ] ; inline + $[ cursor-value-unsafe @ ] ; inline : -out- ( quot -- quot' ) - '[ _ keep set-cursor-value-unsafe ] ; inline + $[ _ keep set-cursor-value-unsafe ] ; inline : -out ( ... begin end quot: ( ... cursor -- ... value ) -- ... ) -out- -each ; inline @@ -366,7 +366,7 @@ M: map-cursor set-cursor-value-unsafe to>> set-cursor-value-unsafe ; inline M: map-cursor set-cursor-value to>> set-cursor-value ; inline : -map- ( begin end quot to -- begin' end' quot' ) - swap [ '[ _ ] bi@ ] dip '[ from>> @ ] -out- ; inline + swap [ $[ _ ] bi@ ] dip $[ from>> @ ] -out- ; inline : -map ( begin end quot to -- begin' end' quot' ) -map- -each ; inline @@ -424,7 +424,7 @@ M: forward-cursor new-sequence-cursor ! : -assoc- ( quot -- quot' ) - '[ cursor-key-value @ ] ; inline + $[ cursor-key-value @ ] ; inline : assoc- ( assoc quot -- begin end quot' ) all- -assoc- ; inline @@ -549,7 +549,7 @@ ALIAS: -2in- -assoc- ; ! : -unzip- ( quot -- quot' ) - '[ [ keys>> cursor-value-unsafe ] [ values>> ] bi @ ] ; inline + $[ [ keys>> cursor-value-unsafe ] [ values>> ] bi @ ] ; inline MACRO: nzip-cursors ( n -- quot ) 1 - [ zip-cursors ] n*quot ; @@ -573,7 +573,7 @@ MACRO: -nin- ( n -- quot ) ! : -with- ( invariant begin end quot -- begin end quot' ) - [ rot ] dip '[ [ _ ] dip @ ] ; inline + [ rot ] dip $[ [ _ ] dip @ ] ; inline : -2with- ( invariant invariant begin end quot -- begin end quot' ) -with- -with- ; inline diff --git a/collections/deques/deques.factor b/collections/deques/deques.factor index ea45f191bc..9590c5cf56 100644 --- a/collections/deques/deques.factor +++ b/collections/deques/deques.factor @@ -33,13 +33,13 @@ ERROR: empty-deque ; push-front* drop ; inline : push-all-front ( seq deque -- ) - '[ _ push-front ] each ; + $[ _ push-front ] each ; : push-back ( obj deque -- ) push-back* drop ; inline : push-all-back ( seq deque -- ) - '[ _ push-back ] each ; + $[ _ push-back ] each ; : pop-front ( deque -- obj ) [ peek-front ] [ pop-front* ] bi ; inline @@ -48,8 +48,8 @@ ERROR: empty-deque ; [ peek-back ] [ pop-back* ] bi ; inline : slurp-deque ( ... deque quot: ( ... obj -- ... ) -- ... ) - [ drop '[ _ deque-empty? ] ] - [ '[ _ pop-back @ ] ] + [ drop $[ _ deque-empty? ] ] + [ $[ _ pop-back @ ] ] 2bi until ; inline MIXIN: deque diff --git a/collections/disjoint-sets/disjoint-sets.factor b/collections/disjoint-sets/disjoint-sets.factor index 5647e12c49..20fd5f7cff 100644 --- a/collections/disjoint-sets/disjoint-sets.factor +++ b/collections/disjoint-sets/disjoint-sets.factor @@ -12,7 +12,7 @@ TUPLE: disjoint-set PRIVATE< : add-count ( p a disjoint-set -- ) - counts>> [ at '[ _ + ] ] [ swap change-at ] bi ; inline + counts>> [ at $[ _ + ] ] [ swap change-at ] bi ; inline : set-parent ( p a disjoint-set -- ) parents>> set-at ; inline @@ -38,10 +38,10 @@ M:: disjoint-set representative ( a disjoint-set -- p ) PRIVATE< : representatives ( a b disjoint-set -- r r ) - '[ _ representative ] bi@ ; inline + $[ _ representative ] bi@ ; inline : ranks ( a b disjoint-set -- r r ) - '[ _ ranks>> at ] bi@ ; inline + $[ _ ranks>> at ] bi@ ; inline :: branch ( a b neg zero pos -- ) a b = zero [ a b < neg pos if ] if ; inline @@ -59,7 +59,7 @@ M: disjoint-set add-atom [ [ 1 ] 2dip counts>> set-at ] 2tri ; -: add-atoms ( seq disjoint-set -- ) '[ _ add-atom ] each ; +: add-atoms ( seq disjoint-set -- ) $[ _ add-atom ] each ; GENERIC: disjoint-set-member? ( a disjoint-set -- ? ) ; @@ -89,7 +89,7 @@ M:: disjoint-set equate ( a b disjoint-set -- ) ] if ; : equate-all-with ( seq a disjoint-set -- ) - '[ _ _ equate ] each ; + $[ _ _ equate ] each ; : equate-all ( seq disjoint-set -- ) over empty? [ 2drop ] [ @@ -102,6 +102,6 @@ M: disjoint-set clone : assoc>disjoint-set ( assoc -- disjoint-set ) [ - [ '[ drop _ add-atom ] assoc-each ] - [ '[ _ equate ] assoc-each ] 2bi + [ $[ drop _ add-atom ] assoc-each ] + [ $[ _ equate ] assoc-each ] 2bi ] keep ; diff --git a/collections/dlists/dlists.factor b/collections/dlists/dlists.factor index 81fd46c161..d95523534c 100644 --- a/collections/dlists/dlists.factor +++ b/collections/dlists/dlists.factor @@ -84,7 +84,7 @@ M: dlist equal? dlist-find-node [ prev>> ] [ f ] if* ; inline : dlist-each-node ( ... dlist quot: ( ... node -- ... ) -- ... ) - '[ @ f ] dlist-find-node drop ; inline + $[ @ f ] dlist-find-node drop ; inline : unlink-node ( dlist-node -- ) [ prev>> ] [ next>> ] bi @@ -131,7 +131,7 @@ M: dlist pop-back* ] change-back normalize-front ; : dlist-find ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f ? ) - '[ obj>> @ ] dlist-find-node [ obj>> t ] [ f f ] if* ; inline + $[ obj>> @ ] dlist-find-node [ obj>> t ] [ f f ] if* ; inline : dlist-any? ( ... dlist quot: ( ... value -- ... ? ) -- ... ? ) dlist-find nip ; inline @@ -160,7 +160,7 @@ M: dlist delete-node ] if* ; inline : delete-node-if ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f ) - '[ obj>> @ ] delete-node-if* drop ; inline + $[ obj>> @ ] delete-node-if* drop ; inline M: dlist clear-deque f >>front f >>back drop ; @@ -171,23 +171,23 @@ M: dlist clear-deque ] dlist-find-node drop ; flushable : dlist-each ( ... dlist quot: ( ... value -- ... ) -- ... ) - '[ obj>> @ ] dlist-each-node ; inline + $[ obj>> @ ] dlist-each-node ; inline : dlist>sequence ( dlist -- seq ) [ ] collector [ dlist-each ] dip ; : >dlist ( seq -- dlist ) - [ '[ _ push-back ] each ] keep ; + [ $[ _ push-back ] each ] keep ; : 1dlist ( obj -- dlist ) [ push-front ] keep ; : dlist-filter ( ... dlist quot: ( ... value -- ... ? ) -- ... dlist' ) [ - '[ _ keep swap [ _ push-back ] [ drop ] if ] dlist-each + $[ _ keep swap [ _ push-back ] [ drop ] if ] dlist-each ] keep ; inline M: dlist clone - [ '[ _ push-back ] dlist-each ] keep ; + [ $[ _ push-back ] dlist-each ] keep ; PRIVATE< diff --git a/collections/documents/documents-tests.factor b/collections/documents/documents-tests.factor index 2bbab6db97..d1ec462c53 100644 --- a/collections/documents/documents-tests.factor +++ b/collections/documents/documents-tests.factor @@ -29,7 +29,7 @@ IN: documents.tests [ { 1 10 } { 2 11 } t f - '[ [ _ _ ] dip 3array , ] each-line + $[ [ _ _ ] dip 3array , ] each-line ] { } make ] unit-test diff --git a/collections/documents/documents.factor b/collections/documents/documents.factor index 457f547b65..1151ed8e19 100644 --- a/collections/documents/documents.factor +++ b/collections/documents/documents.factor @@ -152,7 +152,7 @@ PRIVATE> ] unless ; : change-doc-range ( from to document quot -- ) - '[ doc-range @ ] 3keep set-doc-range ; inline + $[ doc-range @ ] 3keep set-doc-range ; inline : remove-doc-range ( from to document -- ) [ "" ] 3dip set-doc-range ; @@ -189,7 +189,7 @@ PRIVATE> PRIVATE< : undo/redo-edit ( edit document string-quot to-quot -- ) - '[ [ _ [ from>> ] _ tri ] dip set-doc-range ] with-undo ; inline + $[ [ _ [ from>> ] _ tri ] dip set-doc-range ] with-undo ; inline : undo-edit ( edit document -- ) [ old-string>> ] [ new-to>> ] undo/redo-edit ; @@ -199,7 +199,7 @@ PRIVATE< : undo/redo ( document source-quot dest-quot do-quot -- ) [ dupd call [ drop ] ] 2dip - '[ pop swap [ @ push ] _ 2bi ] if-empty ; inline + $[ pop swap [ @ push ] _ 2bi ] if-empty ; inline PRIVATE> diff --git a/collections/documents/elements/elements.factor b/collections/documents/elements/elements.factor index aa0624fb2f..66ff311336 100644 --- a/collections/documents/elements/elements.factor +++ b/collections/documents/elements/elements.factor @@ -59,7 +59,7 @@ PRIVATE< 2dup ?nth blank? ; : break-detector ( ? -- quot ) - '[ blank? _ xor ] ; inline + $[ blank? _ xor ] ; inline : prev-word ( col str ? -- col ) break-detector find-last-from drop ?1+ ; diff --git a/collections/grid-meshes/grid-meshes.factor b/collections/grid-meshes/grid-meshes.factor index 51d132bce0..0e5b82be8c 100644 --- a/collections/grid-meshes/grid-meshes.factor +++ b/collections/grid-meshes/grid-meshes.factor @@ -11,7 +11,7 @@ TUPLE: grid-mesh dim buffer row-length ; PRIVATE< : vertex-array-row ( range z0 z1 -- vertices ) - '[ _ _ [ 0.0 swap 1.0 float-4-boa ] bi-curry@ bi ] + $[ _ _ [ 0.0 swap 1.0 float-4-boa ] bi-curry@ bi ] data-map( object -- float-4[2] ) ; inline : vertex-array ( dim -- vertices ) diff --git a/collections/grouping/extras/extras.factor b/collections/grouping/extras/extras.factor index 16058655bb..c22ba570b4 100644 --- a/collections/grouping/extras/extras.factor +++ b/collections/grouping/extras/extras.factor @@ -20,7 +20,7 @@ IN: grouping.extras MACRO: nclump-map-as ( seq quot exemplar n -- result ) [ nip [1,b) [ [ short tail-slice ] curry ] map swap ] 2keep - '[ _ dup _ cleave _ _ _ nmap-as ] ; + $[ _ dup _ cleave _ _ _ nmap-as ] ; : nclump-map ( seq quot n -- result ) { } swap nclump-map-as ; inline @@ -61,4 +61,4 @@ PRIVATE< PRIVATE> : group-by ( seq quot: ( elt -- key ) -- groups ) - '[ dup _ call( x -- y ) (group-by) ] V{ } clone swap reduce ; + $[ dup _ call( x -- y ) (group-by) ] V{ } clone swap reduce ; diff --git a/collections/heaps/heaps.factor b/collections/heaps/heaps.factor index 8f066a0098..e2857ba526 100644 --- a/collections/heaps/heaps.factor +++ b/collections/heaps/heaps.factor @@ -80,7 +80,7 @@ M: max-heap heap-compare drop { entry entry } declare [ key>> ] bi@ before? ; inline : data-compare ( m n heap -- ? ) - [ '[ _ data-nth ] bi@ ] [ heap-compare ] bi ; inline + [ $[ _ data-nth ] bi@ ] [ heap-compare ] bi ; inline PRIVATE> @@ -116,7 +116,7 @@ M: heap heap-push* heap-push* drop ; : heap-push-all ( assoc heap -- ) - '[ swap _ heap-push ] assoc-each ; + $[ swap _ heap-push ] assoc-each ; PRIVATE< @@ -149,8 +149,8 @@ M: heap heap-pop : slurp-heap ( ... heap quot: ( ... value key -- ... ) -- ... ) [ check-heap ] dip - [ drop '[ _ heap-empty? ] ] - [ '[ _ heap-pop @ ] until ] 2bi ; inline + [ drop $[ _ heap-empty? ] ] + [ $[ _ heap-pop @ ] until ] 2bi ; inline : heap-pop-all ( heap -- alist ) [ heap-size ] keep diff --git a/collections/interval-sets/interval-sets.factor b/collections/interval-sets/interval-sets.factor index 84184b16ec..03eaeb9bc7 100644 --- a/collections/interval-sets/interval-sets.factor +++ b/collections/interval-sets/interval-sets.factor @@ -107,5 +107,5 @@ PRIVATE> : ( set1 set2 -- set ) 2dup interval-max - [ '[ _ ] bi@ ] keep + [ $[ _ ] bi@ ] keep ; diff --git a/collections/io/binary/fast/fast.factor b/collections/io/binary/fast/fast.factor index 4a3ceab6a4..2a57f1d87a 100644 --- a/collections/io/binary/fast/fast.factor +++ b/collections/io/binary/fast/fast.factor @@ -24,8 +24,8 @@ COMPILE< 1 - 8 * 0 swap 8 ; inline : reassemble-bytes ( range -- quot ) - [ [ [ ] ] [ '[ _ shift ] ] if-zero ] map - '[ [ _ spread ] [ bitor ] reduce-outputs ] ; inline + [ [ [ ] ] [ $[ _ shift ] ] if-zero ] map + $[ [ _ spread ] [ bitor ] reduce-outputs ] ; inline MACRO: reassemble-be ( n -- quot ) be-range reassemble-bytes ; diff --git a/collections/io/encodings/detect/detect.factor b/collections/io/encodings/detect/detect.factor index 78a36569cc..c344c717ac 100644 --- a/collections/io/encodings/detect/detect.factor +++ b/collections/io/encodings/detect/detect.factor @@ -16,7 +16,7 @@ PRIVATE< char: > over index [ 1 + head-slice ] when* >string ; : prolog-encoding ( string -- iana-encoding ) - '[ + $[ _ "encoding=" over start 10 + swap [ [ 1 - ] dip nth ] [ index-from ] [ swapd subseq ] 2tri ] [ drop "UTF-8" ] recover ; diff --git a/collections/io/random/random.factor b/collections/io/random/random.factor index b8ae47d232..e6c863b3d9 100644 --- a/collections/io/random/random.factor +++ b/collections/io/random/random.factor @@ -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> diff --git a/collections/io/streams/256color/256color.factor b/collections/io/streams/256color/256color.factor index e48af6ced6..fd342db72f 100644 --- a/collections/io/streams/256color/256color.factor +++ b/collections/io/streams/256color/256color.factor @@ -57,7 +57,7 @@ intensities |[ r i | [ 255 * round >integer ] tri@ 3array ; : color>256color ( color -- 256color ) - color>rgb '[ _ distance ] + color>rgb $[ _ distance ] 256colors [ keys swap infimum-by ] [ at ] bi ; : color>foreground ( color -- string ) diff --git a/collections/io/streams/ansi/ansi.factor b/collections/io/streams/ansi/ansi.factor index 84711b46fa..c969f89298 100644 --- a/collections/io/streams/ansi/ansi.factor +++ b/collections/io/streams/ansi/ansi.factor @@ -37,7 +37,7 @@ CONSTANT: colors H{ [ 255 * round >integer ] tri@ 3array ; : color>ansi ( color -- ansi bold? ) - color>rgb '[ _ distance ] + color>rgb $[ _ distance ] colors [ keys swap infimum-by ] [ at ] bi dup 8 >= [ 8 - t ] [ f ] if ; diff --git a/collections/linked-assocs/linked-assocs.factor b/collections/linked-assocs/linked-assocs.factor index f530299517..32c70bdf18 100644 --- a/collections/linked-assocs/linked-assocs.factor +++ b/collections/linked-assocs/linked-assocs.factor @@ -20,7 +20,7 @@ M: linked-assoc at* PRIVATE< : (delete-at) ( key assoc dlist -- ) - '[ at [ _ delete-node ] when* ] [ delete-at ] 2bi ; inline + $[ at [ _ delete-node ] when* ] [ delete-at ] 2bi ; inline PRIVATE> @@ -36,7 +36,7 @@ PRIVATE> M: linked-assoc set-at [ assoc>> ] [ dlist>> ] bi - '[ _ 2over key? [ 3dup (delete-at) ] when nip add-to-dlist ] + $[ _ 2over key? [ 3dup (delete-at) ] when nip add-to-dlist ] [ set-at ] 2bi ; M: linked-assoc >alist diff --git a/collections/linked-sets/linked-sets.factor b/collections/linked-sets/linked-sets.factor index 2ef7fc9b42..208887c61a 100644 --- a/collections/linked-sets/linked-sets.factor +++ b/collections/linked-sets/linked-sets.factor @@ -17,7 +17,7 @@ M: linked-set clear-set PRIVATE< : (delete-at) ( key assoc dlist -- ) - '[ at [ _ delete-node ] when* ] [ delete-at ] 2bi ; inline + $[ at [ _ delete-node ] when* ] [ delete-at ] 2bi ; inline PRIVATE> @@ -28,7 +28,7 @@ M: linked-set cardinality assoc>> assoc-size ; M: linked-set adjoin [ assoc>> ] [ dlist>> ] bi - '[ _ 2over key? [ 3dup (delete-at) ] when nip push-back* ] + $[ _ 2over key? [ 3dup (delete-at) ] when nip push-back* ] [ set-at ] 2bi ; M: linked-set members diff --git a/collections/memory/pools/pools.factor b/collections/memory/pools/pools.factor index ad6bcc72ba..21a029e391 100644 --- a/collections/memory/pools/pools.factor +++ b/collections/memory/pools/pools.factor @@ -10,7 +10,7 @@ TUPLE: pool : ( size class -- pool ) [ nip new ] - [ '[ _ new ] V{ } replicate-as ] 2bi + [ $[ _ new ] V{ } replicate-as ] 2bi pool boa ; : pool-size ( pool -- size ) @@ -50,4 +50,4 @@ PRIVATE> dup class-of class-pool pool-free ; SYNTAX: \ POOL: - scan-word scan-word ";" expect '[ _ swap ] [ swap set-class-pool ] bi ; + scan-word scan-word ";" expect $[ _ swap ] [ swap set-class-pool ] bi ; diff --git a/collections/persistent/hashtables/hashtables-tests.factor b/collections/persistent/hashtables/hashtables-tests.factor index ed448908de..caa41849cb 100644 --- a/collections/persistent/hashtables/hashtables-tests.factor +++ b/collections/persistent/hashtables/hashtables-tests.factor @@ -86,7 +86,7 @@ COMPILE> : random-assocs ( n -- hash phash ) [ random-string ] replicate - [ H{ } clone [ '[ swap _ set-at ] each-index ] keep ] + [ H{ } clone [ $[ swap _ set-at ] each-index ] keep ] [ PH{ } clone swap |[ ph elt i | i elt ph new-at ] each-index ] bi ; diff --git a/collections/persistent/hashtables/nodes/collision/collision.factor b/collections/persistent/hashtables/nodes/collision/collision.factor index 3d1612862a..7e47583b65 100644 --- a/collections/persistent/hashtables/nodes/collision/collision.factor +++ b/collections/persistent/hashtables/nodes/collision/collision.factor @@ -8,7 +8,7 @@ persistent.hashtables.nodes.leaf ; IN: persistent.hashtables.nodes.collision : find-index ( key hashcode collision-node -- n leaf-node ) - leaves>> -rot '[ [ _ _ ] dip matching-key? ] find ; inline + leaves>> -rot $[ [ _ _ ] dip matching-key? ] find ; inline M:: collision-node (entry-at) ( key hashcode collision-node -- leaf-node ) key hashcode collision-node find-index nip ; diff --git a/collections/quadtrees/quadtrees.factor b/collections/quadtrees/quadtrees.factor index 2745fe25a5..4670a50043 100644 --- a/collections/quadtrees/quadtrees.factor +++ b/collections/quadtrees/quadtrees.factor @@ -195,4 +195,4 @@ M: quadtree clear-assoc ( assoc -- ) : swizzle ( sequence quot -- sequence' ) [ dup ] dip map [ zip ] [ rect-containing ] bi - [ '[ first2 _ set-at ] each ] [ values ] bi ; inline + [ $[ first2 _ set-at ] each ] [ values ] bi ; inline diff --git a/collections/sequences/abbrev/abbrev.factor b/collections/sequences/abbrev/abbrev.factor index 9092c84576..e968713433 100644 --- a/collections/sequences/abbrev/abbrev.factor +++ b/collections/sequences/abbrev/abbrev.factor @@ -9,10 +9,10 @@ PRIVATE< dup length [1,b] [ head ] with map ; : (abbrev) ( seq -- assoc ) - [ prefixes ] keep 1array '[ _ ] H{ } map>assoc ; + [ prefixes ] keep 1array $[ _ ] H{ } map>assoc ; : assoc-merge ( assoc1 assoc2 -- assoc3 ) - [ '[ over _ at [ append ] when* ] assoc-map ] keep swap assoc-union ; + [ $[ over _ at [ append ] when* ] assoc-map ] keep swap assoc-union ; PRIVATE> diff --git a/collections/sequences/cords/cords.factor b/collections/sequences/cords/cords.factor index b465e6fc63..3090430dc6 100644 --- a/collections/sequences/cords/cords.factor +++ b/collections/sequences/cords/cords.factor @@ -93,8 +93,8 @@ M: cord vandn [ vandn ] [ call-next-method ] cord-2map ; M: cord vor [ vor ] [ call-next-method ] cord-2map ; inline M: cord vxor [ vxor ] [ call-next-method ] cord-2map ; inline M: cord vnot [ vnot ] cord-map ; inline -M: cord vlshift '[ _ vlshift ] cord-map ; inline -M: cord vrshift '[ _ vrshift ] cord-map ; inline +M: cord vlshift $[ _ vlshift ] cord-map ; inline +M: cord vrshift $[ _ vrshift ] cord-map ; inline M: cord (vmerge-head) [ head>> ] bi@ (vmerge) cord-append ; inline M: cord (vmerge-tail) [ tail>> ] bi@ (vmerge) cord-append ; inline M: cord v<= [ v<= ] [ call-next-method ] cord-2map ; inline @@ -114,10 +114,10 @@ M: cord n+v [ n+v ] with cord-map ; inline M: cord n-v [ n-v ] with cord-map ; inline M: cord n*v [ n*v ] with cord-map ; inline M: cord n/v [ n/v ] with cord-map ; inline -M: cord v+n '[ _ v+n ] cord-map ; inline -M: cord v-n '[ _ v-n ] cord-map ; inline -M: cord v*n '[ _ v*n ] cord-map ; inline -M: cord v/n '[ _ v/n ] cord-map ; inline +M: cord v+n $[ _ v+n ] cord-map ; inline +M: cord v-n $[ _ v-n ] cord-map ; inline +M: cord v*n $[ _ v*n ] cord-map ; inline +M: cord v/n $[ _ v/n ] cord-map ; inline M: cord norm-sq [ norm-sq ] cord-both + ; inline M: cord distance v- norm ; inline diff --git a/collections/sequences/deep/deep.factor b/collections/sequences/deep/deep.factor index f25bbc38bc..470fdbb1f6 100644 --- a/collections/sequences/deep/deep.factor +++ b/collections/sequences/deep/deep.factor @@ -14,14 +14,14 @@ M: object branch? drop f ; : deep-each ( ... obj quot: ( ... elt -- ... ) -- ... ) [ call ] 2keep over branch? - [ '[ _ deep-each ] each ] [ 2drop ] if ; inline recursive + [ $[ _ deep-each ] each ] [ 2drop ] if ; inline recursive : deep-reduce ( ... obj identity quot: ( ... prev elt -- ... next ) -- ... result ) swapd deep-each ; inline : deep-map ( ... obj quot: ( ... elt -- ... elt' ) -- ... newobj ) [ call ] keep over branch? - [ '[ _ deep-map ] map ] [ drop ] if ; inline recursive + [ $[ _ deep-map ] map ] [ drop ] if ; inline recursive : deep-filter-as ( ... obj quot: ( ... elt -- ... ? ) exemplar -- ... seq ) [ selector [ deep-each ] dip ] dip [ like ] when* ; inline recursive @@ -32,7 +32,7 @@ M: object branch? drop f ; : (deep-find) ( ... obj quot: ( ... elt -- ... ? ) -- ... elt ? ) [ call ] 2keep rot [ drop t ] [ over branch? [ - [ f ] 2dip '[ nip _ (deep-find) ] any? + [ f ] 2dip $[ nip _ (deep-find) ] any? ] [ 2drop f f ] if ] if ; inline recursive @@ -41,21 +41,21 @@ M: object branch? drop f ; : deep-any? ( ... obj quot: ( ... elt -- ... ? ) -- ... ? ) (deep-find) nip ; inline : deep-all? ( ... obj quot: ( ... elt -- ... ? ) -- ... ? ) - '[ @ not ] deep-any? not ; inline + $[ @ not ] deep-any? not ; inline : deep-member? ( obj seq -- ? ) - swap '[ + swap $[ _ swap dup branch? [ member? ] [ 2drop f ] if ] deep-find >boolean ; : deep-subseq? ( subseq seq -- ? ) - swap '[ + swap $[ _ swap dup branch? [ subseq? ] [ 2drop f ] if ] deep-find >boolean ; : deep-map! ( ... obj quot: ( ... elt -- ... elt' ) -- ... obj ) over branch? [ - '[ _ [ call ] keep over [ deep-map! drop ] dip ] map! + $[ _ [ call ] keep over [ deep-map! drop ] dip ] map! ] [ drop ] if ; inline recursive : flatten ( obj -- seq ) diff --git a/collections/sequences/extras/extras.factor b/collections/sequences/extras/extras.factor index 160410b9e1..4dadda7424 100644 --- a/collections/sequences/extras/extras.factor +++ b/collections/sequences/extras/extras.factor @@ -36,7 +36,7 @@ IN: sequences.extras [ 0 len clamp ] bi@ dupd max seq subseq ; : safe-subseq ( from to seq -- subseq ) - [ length '[ 0 _ clamp ] bi@ ] keep subseq ; + [ length $[ 0 _ clamp ] bi@ ] keep subseq ; : all-subseqs ( seq -- seqs ) dup length [1,b] [ clump ] with map concat ; @@ -52,11 +52,11 @@ IN: sequences.extras ] each ; inline : map-like ( seq exemplar -- seq' ) - '[ _ like ] map ; inline + $[ _ like ] map ; inline : filter-all-subseqs-range ( ... seq range quot: ( ... x -- ... ) -- seq ) [ - '[ _ filter ] with map concat + $[ _ filter ] with map concat ] 3keep 2drop map-like ; inline : filter-all-subseqs ( ... seq quot: ( ... x -- ... ) -- seq ) @@ -184,14 +184,14 @@ PRIVATE> : slices-touch? ( slice1 slice2 -- ? ) unordered-slices-touch? ; -ERROR: slices-don't-touch slice1 slice2 ; +ERROR: slices-dont-touch slice1 slice2 ; : merge-slices ( slice1 slice2 -- slice/* ) slice-order-by-from 2dup ordered-slices-touch? [ [ from>> ] [ [ to>> ] [ seq>> ] bi ] bi* ] [ - slices-don't-touch + slices-dont-touch ] if ; : rotate ( seq n -- seq' ) @@ -265,7 +265,7 @@ PRIVATE> PRIVATE< : (setup-each-from) ( i seq -- n quot ) - [ length over [-] swap ] keep '[ _ + _ nth-unsafe ] ; inline + [ length over [-] swap ] keep $[ _ + _ nth-unsafe ] ; inline : setup-each-from ( i seq quot -- n quot' ) [ (setup-each-from) ] dip compose ; inline @@ -452,7 +452,7 @@ PRIVATE> : nth? ( ... n seq quot: ( ... elt -- ... ? ) -- ... ? ) [ nth ] dip call ; inline : loop>sequence ( quot exemplar -- seq ) - [ '[ [ @ [ [ , ] when* ] keep ] loop ] ] dip make ; inline + [ $[ [ @ [ [ , ] when* ] keep ] loop ] ] dip make ; inline : loop>array ( quot -- seq ) { } loop>sequence ; inline @@ -473,14 +473,14 @@ PRIVATE> : insert-nth! ( elt n seq -- ) [ length ] keep ensure swap pick (a,b] - over '[ [ 1 + ] keep _ move-unsafe ] each + over $[ [ 1 + ] keep _ move-unsafe ] each set-nth-unsafe ; : set-nths ( value indices seq -- ) - swapd '[ _ swap _ set-nth ] each ; inline + swapd $[ _ swap _ set-nth ] each ; inline : set-nths-unsafe ( value indices seq -- ) - swapd '[ _ swap _ set-nth-unsafe ] each ; inline + swapd $[ _ swap _ set-nth-unsafe ] each ; inline : flatten1 ( obj -- seq ) [ @@ -502,7 +502,7 @@ PRIVATE> : map-find-index ( ... seq quot: ( ... elt index -- ... result/f ) -- ... result i elt ) [ find-index ] (map-find-index) ; inline -: filter-length ( seq n -- seq' ) '[ length _ = ] filter ; +: filter-length ( seq n -- seq' ) $[ length _ = ] filter ; : all-shortest ( seqs -- seqs' ) dup shortest length filter-length ; @@ -589,7 +589,7 @@ PRIVATE> [ drop length 1 - ] [ change-nth-unsafe ] 2bi ; inline : replicate-into ( ... seq quot: ( ... -- ... newelt ) -- ... ) - over [ length ] 2dip '[ _ dip _ set-nth-unsafe ] each-integer ; inline + over [ length ] 2dip $[ _ dip _ set-nth-unsafe ] each-integer ; inline : count* ( ... seq quot: ( ... elt -- ... ? ) -- ... % ) over [ count ] [ length ] bi* / ; inline @@ -618,10 +618,10 @@ PRIVATE> start-all* length ; inline : map-zip ( quot: ( x -- y ) -- alist ) - '[ _ keep swap ] map>alist ; inline + $[ _ keep swap ] map>alist ; inline : map-keys ( assoc quot: ( key -- key' ) -- assoc ) - '[ _ dip ] assoc-map ; inline + $[ _ dip ] assoc-map ; inline : map-values ( assoc quot: ( value -- value' ) -- assoc ) - '[ swap _ dip swap ] assoc-map ; inline + $[ swap _ dip swap ] assoc-map ; inline diff --git a/collections/sequences/parser/parser.factor b/collections/sequences/parser/parser.factor index 488e396d51..9e1578dc41 100644 --- a/collections/sequences/parser/parser.factor +++ b/collections/sequences/parser/parser.factor @@ -116,7 +116,7 @@ TUPLE: sequence-parser sequence n ; [ take-rest-slice ] [ sequence>> like ] bi f like ; : take-until-object ( sequence-parser obj -- sequence ) - '[ current _ = ] take-until ; + $[ current _ = ] take-until ; : parse-sequence ( sequence quot -- ) [ ] dip call ; inline @@ -139,7 +139,7 @@ COMPILE< "length" [ length ] define-sorting COMPILE> : take-first-matching ( sequence-parser seq -- seq ) swap - '[ _ [ swap take-sequence ] with-sequence-parser ] find nip ; + $[ _ [ swap take-sequence ] with-sequence-parser ] find nip ; : take-longest ( sequence-parser seq -- seq ) sort-tokens take-first-matching ; diff --git a/collections/sequences/squish/squish.factor b/collections/sequences/squish/squish.factor index 214c6895e2..d3cc4dd22f 100644 --- a/collections/sequences/squish/squish.factor +++ b/collections/sequences/squish/squish.factor @@ -3,7 +3,7 @@ USING: combinators.short-circuit fry make math kernel sequences ; IN: sequences.squish : (squish) ( seq quot: ( obj -- ? ) -- ) - 2dup call [ '[ _ (squish) ] each ] [ drop , ] if ; inline recursive + 2dup call [ $[ _ (squish) ] each ] [ drop , ] if ; inline recursive : squish ( seq quot exemplar -- seq' ) [ [ (squish) ] ] dip make ; inline diff --git a/collections/sequences/unrolled/unrolled.factor b/collections/sequences/unrolled/unrolled.factor index edf888594e..50a7ea7124 100644 --- a/collections/sequences/unrolled/unrolled.factor +++ b/collections/sequences/unrolled/unrolled.factor @@ -6,14 +6,14 @@ IN: sequences.unrolled PRIVATE< : (unrolled-each-integer) ( quot n -- ) - swap '[ _ call( i -- ) ] each-integer ; + swap $[ _ call( i -- ) ] each-integer ; COMPILE< \ (unrolled-each-integer) [ - iota [ '[ _ swap call( i -- ) ] ] [ ] map-as '[ _ cleave ] + iota [ $[ _ swap call( i -- ) ] ] [ ] map-as $[ _ cleave ] ] 1 define-partial-eval COMPILE> : (unrolled-collect) ( quot into -- quot' ) - '[ dup @ swap _ set-nth-unsafe ] ; inline + $[ dup @ swap _ set-nth-unsafe ] ; inline PRIVATE> @@ -42,13 +42,13 @@ PRIVATE< [ xseq yseq len quot ] if ; inline : (unrolled-each) ( seq len quot -- len quot ) - swapd '[ _ nth-unsafe @ ] ; inline + swapd $[ _ nth-unsafe @ ] ; inline : (unrolled-each-index) ( seq len quot -- len quot ) - swapd '[ dup _ nth-unsafe swap @ ] ; inline + swapd $[ dup _ nth-unsafe swap @ ] ; inline : (unrolled-2each) ( xseq yseq len quot -- len quot ) - [ '[ _ ] 2dip ] dip (2each) nip ; inline + [ $[ _ ] 2dip ] dip (2each) nip ; inline : unrolled-each-unsafe ( seq len quot: ( x -- ) -- ) (unrolled-each) unrolled-each-integer ; inline diff --git a/collections/sequences/windowed/windowed.factor b/collections/sequences/windowed/windowed.factor index 4269309983..d1806c269c 100644 --- a/collections/sequences/windowed/windowed.factor +++ b/collections/sequences/windowed/windowed.factor @@ -45,4 +45,4 @@ M: windowed-sequence length [ infimum ] rolling-map ; : rolling-count ( ... u n quot: ( ... elt -- ... ? ) -- ... v ) - '[ _ count ] rolling-map ; inline + $[ _ count ] rolling-map ; inline diff --git a/collections/specialized-arrays/specialized-arrays.factor b/collections/specialized-arrays/specialized-arrays.factor index 67bcf07983..068bfc0a02 100644 --- a/collections/specialized-arrays/specialized-arrays.factor +++ b/collections/specialized-arrays/specialized-arrays.factor @@ -128,7 +128,7 @@ PRIVATE> : define-array-vocab ( type -- vocab ) underlying-type - [ specialized-array-vocab ] [ '[ _ define-array ] ] bi + [ specialized-array-vocab ] [ $[ _ define-array ] ] bi generate-vocab ; ERROR: specialized-array-vocab-not-loaded c-type ; diff --git a/collections/specialized-vectors/specialized-vectors.factor b/collections/specialized-vectors/specialized-vectors.factor index 9464e434e4..4b52e18de4 100644 --- a/collections/specialized-vectors/specialized-vectors.factor +++ b/collections/specialized-vectors/specialized-vectors.factor @@ -73,7 +73,7 @@ PRIVATE> : define-vector-vocab ( type -- vocab ) underlying-type - [ specialized-vector-vocab ] [ '[ _ define-vector ] ] bi + [ specialized-vector-vocab ] [ $[ _ define-vector ] ] bi generate-vocab ; SYNTAX: \ SPECIALIZED-VECTORS: diff --git a/collections/strings/tables/tables.factor b/collections/strings/tables/tables.factor index e5e8d1e00f..4eb933719c 100644 --- a/collections/strings/tables/tables.factor +++ b/collections/strings/tables/tables.factor @@ -6,10 +6,10 @@ IN: strings.tables PRIVATE< : format-row ( seq -- seq ) - dup longest length '[ _ "" pad-tail ] map! ; + dup longest length $[ _ "" pad-tail ] map! ; : format-column ( seq -- seq ) - dup longest length '[ _ char: \s pad-tail ] map! ; + dup longest length $[ _ char: \s pad-tail ] map! ; PRIVATE> diff --git a/collections/suffix-arrays/suffix-arrays.factor b/collections/suffix-arrays/suffix-arrays.factor index 818a5a0d96..6395f59893 100644 --- a/collections/suffix-arrays/suffix-arrays.factor +++ b/collections/suffix-arrays/suffix-arrays.factor @@ -16,10 +16,10 @@ PRIVATE< [ prefix<=> ] with search drop ; : query-from ( index begin suffix-array -- from ) - swap '[ _ head? not ] find-last-from drop [ 1 + ] [ 0 ] if* ; + swap $[ _ head? not ] find-last-from drop [ 1 + ] [ 0 ] if* ; : query-to ( index begin suffix-array -- to ) - [ swap '[ _ head? not ] find-from drop ] [ length or ] bi ; + [ swap $[ _ head? not ] find-from drop ] [ length or ] bi ; : query-range ( index begin suffix-array -- from to ) [ query-from ] [ query-to ] 3bi [ min ] keep ; @@ -35,4 +35,4 @@ PRIVATE> SYNTAX: \ SA{ \ } [ >suffix-array ] parse-literal ; : query ( begin suffix-array -- matches ) - [ find-index ] 2keep '[ _ _ (query) ] [ { } ] if* ; + [ find-index ] 2keep $[ _ _ (query) ] [ { } ] if* ; diff --git a/collections/trees/avl/avl.factor b/collections/trees/avl/avl.factor index 3e41f95f2b..4d90b1577b 100644 --- a/collections/trees/avl/avl.factor +++ b/collections/trees/avl/avl.factor @@ -20,7 +20,7 @@ TUPLE: avl-node < node balance ; 0 >>balance ; inline : increase-balance ( node amount -- node ) - '[ _ + ] change-balance ; + $[ _ + ] change-balance ; : rotate ( node -- node ) dup diff --git a/core/alien/alien-tests.factor b/core/alien/alien-tests.factor index 107ebf6ab3..864e5d37a2 100644 --- a/core/alien/alien-tests.factor +++ b/core/alien/alien-tests.factor @@ -89,7 +89,7 @@ f initialize-test set-global ! Generate callbacks until the whole callback-heap is full, then free ! them. Do it ten times in a row for good measure. : produce-until-error ( quot -- error seq ) - '[ [ @ t ] [ f ] recover ] [ ] produce ; inline + $[ [ @ t ] [ f ] recover ] [ ] produce ; inline SYMBOL: foo diff --git a/core/alien/c-types/c-types.factor b/core/alien/c-types/c-types.factor index b1521259d9..19327f272e 100644 --- a/core/alien/c-types/c-types.factor +++ b/core/alien/c-types/c-types.factor @@ -124,7 +124,7 @@ MACRO: alien-copy-value ( c-type -- quot: ( c-ptr offset -- value ) ) [ c-type-getter ] [ c-type-copier ] [ c-type-boxer-quot ] tri 3append ; MACRO: set-alien-value ( c-type -- quot: ( value c-ptr offset -- ) ) - [ c-type-unboxer-quot [ [ ] ] [ '[ _ 2dip ] ] if-empty ] + [ c-type-unboxer-quot [ [ ] ] [ $[ _ 2dip ] ] if-empty ] [ c-type-setter ] bi append ; @@ -213,7 +213,7 @@ PRIVATE< ] [ drop t ] if ; : (pointer-c-type) ( void* type -- void*' ) - [ clone ] dip c-type-boxer-quot '[ _ [ f ] if* ] >>boxer-quot ; + [ clone ] dip c-type-boxer-quot $[ _ [ f ] if* ] >>boxer-quot ; PRIVATE> diff --git a/core/alien/libraries/libraries.factor b/core/alien/libraries/libraries.factor index 084c61bfbe..45f0b3cb78 100755 --- a/core/alien/libraries/libraries.factor +++ b/core/alien/libraries/libraries.factor @@ -58,7 +58,7 @@ M: library dispose dll>> [ dispose ] when* ; [ swap path>> = ] [ swap abi>> = ] bi-curry* bi and ; : add-library? ( name path abi -- ? ) - [ lookup-library ] 2dip '[ _ _ same-library? not ] [ t ] if* ; + [ lookup-library ] 2dip $[ _ _ same-library? not ] [ t ] if* ; : add-library ( name path abi -- ) 3dup add-library? [ diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 201a42fa50..b6462656a9 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -108,7 +108,7 @@ IN: bootstrap.syntax "::" "M::" "MEMO:" "MEMO::" "MACRO:" "MACRO::" "IDENTITY-MEMO:" "IDENTITY-MEMO::" "TYPED:" "TYPED::" ":>" "|[" "let[" "MEMO[" - "'[" + "$[" "_" "@" "IH{" diff --git a/core/combinators/short-circuit/short-circuit.factor b/core/combinators/short-circuit/short-circuit.factor index 394d3b5130..d773b14eb8 100644 --- a/core/combinators/short-circuit/short-circuit.factor +++ b/core/combinators/short-circuit/short-circuit.factor @@ -6,18 +6,18 @@ PRIVATE< MACRO: keeping ( n quot -- quot' ) swap dup 1 + - '[ _ _ nkeep _ nrot ] ; + $[ _ _ nkeep _ nrot ] ; PRIVATE> MACRO: n&& ( quots n -- quot ) [ [ [ f ] ] 2dip swap [ - [ '[ drop _ _ keeping dup not ] ] - [ drop '[ drop _ ndrop f ] ] + [ $[ drop _ _ keeping dup not ] ] + [ drop $[ drop _ ndrop f ] ] 2bi 2array ] with map - ] [ '[ _ nnip ] suffix 1array ] bi + ] [ $[ _ nnip ] suffix 1array ] bi [ cond ] 3append ; PRIVATE< @@ -35,11 +35,11 @@ PRIVATE> MACRO: n|| ( quots n -- quot ) [ [ [ f ] ] 2dip swap [ - [ '[ drop _ _ keeping dup ] ] - [ drop '[ _ nnip ] ] + [ $[ drop _ _ keeping dup ] ] + [ drop $[ _ nnip ] ] 2bi 2array ] with map - ] [ '[ drop _ ndrop t ] [ f ] 2array suffix 1array ] bi + ] [ $[ drop _ ndrop t ] [ f ] 2array suffix 1array ] bi [ cond ] 3append ; PRIVATE< diff --git a/core/combinators/short-circuit/smart/smart.factor b/core/combinators/short-circuit/smart/smart.factor index f4083089a4..baecec165e 100644 --- a/core/combinators/short-circuit/smart/smart.factor +++ b/core/combinators/short-circuit/smart/smart.factor @@ -13,6 +13,6 @@ ERROR: cannot-determine-arity ; PRIVATE> -MACRO: && ( quots -- quot ) dup arity '[ _ _ n&& ] ; +MACRO: && ( quots -- quot ) dup arity $[ _ _ n&& ] ; -MACRO: || ( quots -- quot ) dup arity '[ _ _ n|| ] ; +MACRO: || ( quots -- quot ) dup arity $[ _ _ n|| ] ; diff --git a/core/command-line/command-line.factor b/core/command-line/command-line.factor index 9d4ccda7f3..beef63511d 100644 --- a/core/command-line/command-line.factor +++ b/core/command-line/command-line.factor @@ -29,7 +29,7 @@ SYMBOL: command-line home prepend-path ; : try-user-init ( file -- ) - "user-init" get swap '[ + "user-init" get swap $[ _ [ ?run-file ] [ swap user-init-errors get set-at diff --git a/core/compiler/errors/errors.factor b/core/compiler/errors/errors.factor index 2c61621762..a8e3b5c722 100644 --- a/core/compiler/errors/errors.factor +++ b/core/compiler/errors/errors.factor @@ -45,7 +45,7 @@ T{ error-type-holder \ linkage-error ; : set-linkage-error ( name message word class -- ) - '[ _ boa ] dip dup asset>> linkage-errors get set-at ; inline + $[ _ boa ] dip dup asset>> linkage-errors get set-at ; inline T{ error-type-holder { type +linkage-error+ } diff --git a/core/compiler/units/units-tests.factor b/core/compiler/units/units-tests.factor index 6e70c27131..d211660e30 100644 --- a/core/compiler/units/units-tests.factor +++ b/core/compiler/units/units-tests.factor @@ -18,7 +18,7 @@ IN: compiler.units.tests gensym "b" set [ "a" get [ "A" ] define - "b" get "a" get '[ _ execute ] define + "b" get "a" get $[ _ execute ] define ] with-compilation-unit "b" get execute [ diff --git a/core/continuations/continuations-tests.factor b/core/continuations/continuations-tests.factor index c305129a0a..b761a50f2b 100644 --- a/core/continuations/continuations-tests.factor +++ b/core/continuations/continuations-tests.factor @@ -50,11 +50,11 @@ IN: continuations.tests gc ] unit-test -: don't-compile-me ( -- ) ; -: foo ( -- ) get-callstack "c" set don't-compile-me ; +: dont-compile-me ( -- ) ; +: foo ( -- ) get-callstack "c" set dont-compile-me ; : bar ( -- a b ) 1 foo 2 ; -COMPILE< { don't-compile-me foo bar } [ t "no-compile" set-word-prop ] each COMPILE> +COMPILE< { dont-compile-me foo bar } [ t "no-compile" set-word-prop ] each COMPILE> { 1 2 } [ bar ] unit-test diff --git a/core/delegate/delegate.factor b/core/delegate/delegate.factor index 4df58bed4a..b5d9fb5b6c 100644 --- a/core/delegate/delegate.factor +++ b/core/delegate/delegate.factor @@ -65,10 +65,10 @@ M: consult-method reset-word GENERIC#: (consult-method-quot) 2 ( consultation quot word -- object ) ; M: consultation (consult-method-quot) - '[ _ call _ execute ] nip ; + $[ _ call _ execute ] nip ; M: broadcast (consult-method-quot) - '[ _ call [ _ execute ] each ] nip ; + $[ _ call [ _ execute ] each ] nip ; : consult-method-quot ( consultation word -- object ) [ dup quot>> ] dip @@ -85,7 +85,7 @@ M: broadcast (consult-method-quot) : register-consult ( consultation -- ) [ group>> "protocol-consult" ] [ ] [ class>> ] tri - '[ [ _ _ ] dip ?set-at ] change-word-prop ; + $[ [ _ _ ] dip ?set-at ] change-word-prop ; : consult-methods ( consultation -- ) [ define-consult-method ] each-generic ; diff --git a/core/effects/effects-tests.factor b/core/effects/effects-tests.factor index 707396b6ed..d01ced38aa 100644 --- a/core/effects/effects-tests.factor +++ b/core/effects/effects-tests.factor @@ -48,7 +48,7 @@ IN: effects.tests [ error>> invalid-row-variable? ] must-fail-with [ "( ..a: integer b c -- d )" eval( -- effect ) ] -[ error>> row-variable-can't-have-type? ] must-fail-with +[ error>> row-variable-cant-have-type? ] must-fail-with ! test curry-effect { ( -- x ) } [ ( c -- d ) curry-effect ] unit-test diff --git a/core/effects/parser/parser.factor b/core/effects/parser/parser.factor index 40656872f3..c6d99d7228 100644 --- a/core/effects/parser/parser.factor +++ b/core/effects/parser/parser.factor @@ -9,7 +9,7 @@ DEFER: parse-effect ERROR: bad-effect ; ERROR: invalid-row-variable ; -ERROR: row-variable-can't-have-type ; +ERROR: row-variable-cant-have-type ; ERROR: stack-effect-omits-dashes ; SYMBOL: effect-var @@ -23,7 +23,7 @@ PRIVATE< : parse-effect-var ( first? var name -- var ) nip - [ ":" ?tail [ row-variable-can't-have-type ] when ] curry + [ ":" ?tail [ row-variable-cant-have-type ] when ] curry [ invalid-row-variable ] if ; : parse-effect-value ( token -- value ) @@ -67,11 +67,11 @@ PRIVATE> CONSTANT: in-definition HS{ } ; -ERROR: can't-nest-definitions word ; +ERROR: cant-nest-definitions word ; : set-in-definition ( -- ) manifest get current-vocab>> t or in-definition ?adjoin - [ last-word can't-nest-definitions ] unless ; + [ last-word cant-nest-definitions ] unless ; : unset-in-definition ( -- ) manifest get current-vocab>> t or in-definition delete ; diff --git a/core/fry/fry-docs.factor b/core/fry/fry-docs.factor index 1035a367bc..f20811e54c 100644 --- a/core/fry/fry-docs.factor +++ b/core/fry/fry-docs.factor @@ -12,67 +12,67 @@ HELP: @ HELP: fry { $values { "quot" quotation } { "quot'" quotation } } { $description "Outputs a quotation that when called, fries " { $snippet "quot" } " by taking values from the stack and substituting them in." } -{ $notes "This word is used to implement " { $link postpone\ '[ } "; the following two lines are equivalent:" - { $code "[ X ] fry call" "'[ X ]" } +{ $notes "This word is used to implement " { $link postpone\ $[ } "; the following two lines are equivalent:" + { $code "[ X ] fry call" "$[ X ]" } } { $examples "See " { $link "fry.examples" } "." } ; -HELP: \ '[ -{ $syntax "'[ code... ]" } +HELP: \ $[ +{ $syntax "$[ code... ]" } { $description "Literal fried quotation. Expands into code which takes values from the stack and substitutes them in place of the fry specifiers " { $link _ } " and " { $link @ } "." } { $examples "See " { $link "fry.examples" } "." } ; HELP: >r/r>-in-fry-error -{ $error-description "Thrown by " { $link postpone\ '[ } " if the fried quotation contains calls to retain stack manipulation primitives." } ; +{ $error-description "Thrown by " { $link postpone\ $[ } " if the fried quotation contains calls to retain stack manipulation primitives." } ; ARTICLE: "fry.examples" "Examples of fried quotations" "The easiest way to understand fried quotations is to look at some examples." $nl -"If a quotation does not contain any fry specifiers, then " { $link postpone\ '[ } " behaves just like " { $link postpone\ [ } ":" -{ $code "{ 10 20 30 } '[ . ] each" } +"If a quotation does not contain any fry specifiers, then " { $link postpone\ $[ } " behaves just like " { $link postpone\ [ } ":" +{ $code "{ 10 20 30 } $[ . ] each" } "Occurrences of " { $link _ } " on the left map directly to " { $link curry } ". That is, the following three lines are equivalent:" { $code - "{ 10 20 30 } 5 '[ _ + ] map" + "{ 10 20 30 } 5 $[ _ + ] map" "{ 10 20 30 } 5 [ + ] curry map" "{ 10 20 30 } [ 5 + ] map" } "Occurrences of " { $link _ } " in the middle of a quotation map to more complex quotation composition patterns. The following three lines are equivalent:" { $code - "{ 10 20 30 } 5 '[ 3 _ / ] map" + "{ 10 20 30 } 5 $[ 3 _ / ] map" "{ 10 20 30 } 5 [ 3 ] swap [ / ] curry compose map" "{ 10 20 30 } [ 3 5 / ] map" } "Occurrences of " { $link @ } " are simply syntax sugar for " { $snippet "_ call" } ". The following four lines are equivalent:" { $code - "{ 10 20 30 } [ sq ] '[ @ . ] each" + "{ 10 20 30 } [ sq ] $[ @ . ] each" "{ 10 20 30 } [ sq ] [ call . ] curry each" "{ 10 20 30 } [ sq ] [ . ] compose each" "{ 10 20 30 } [ sq . ] each" } "The " { $link _ } " and " { $link @ } " specifiers may be freely mixed, and the result is considerably more concise and readable than the version using " { $link curry } " and " { $link compose } " directly:" { $code - "{ 8 13 14 27 } [ even? ] 5 '[ @ dup _ ? ] map" + "{ 8 13 14 27 } [ even? ] 5 $[ @ dup _ ? ] map" "{ 8 13 14 27 } [ even? ] 5 [ dup ] swap [ ? ] curry compose compose map" "{ 8 13 14 27 } [ even? dup 5 ? ] map" } "The following is a no-op:" -{ $code "'[ @ ]" } +{ $code "$[ @ ]" } "Here are some built-in combinators rewritten in terms of fried quotations:" { $table - { { $link literalize } { $snippet ": literalize '[ _ ] ;" } } - { { $link curry } { $snippet ": curry '[ _ @ ] ;" } } - { { $link compose } { $snippet ": compose '[ @ @ ] ;" } } + { { $link literalize } { $snippet ": literalize $[ _ ] ;" } } + { { $link curry } { $snippet ": curry $[ _ @ ] ;" } } + { { $link compose } { $snippet ": compose $[ @ @ ] ;" } } } ; ARTICLE: "fry.philosophy" "Fried quotation philosophy" "Fried quotations generalize quotation-building words such as " { $link curry } " and " { $link compose } ". They can clean up code with lots of currying and composition, particularly when quotations are nested:" { $code - "'[ [ _ key? ] all? ] filter" + "$[ [ _ key? ] all? ] filter" "[ [ key? ] curry all? ] curry filter" } "There is a mapping from fried quotations to lexical closures as defined in the " { $vocab-link "locals" } " vocabulary. Namely, a fried quotation is equivalent to a " { $snippet "|[ | ]" } " form where each local binding is only used once, and bindings are used in the same order in which they are defined. The following two lines are equivalent:" { $code - "'[ 3 _ + 4 _ / ]" + "$[ 3 _ + 4 _ / ]" "|[ a b | 3 a + 4 b / ]" } ; @@ -80,7 +80,7 @@ ARTICLE: "fry" "Fried quotations" "The " { $vocab-link "fry" } " vocabulary implements " { $emphasis "fried quotation" } ". Conceptually, fried quotations are quotations with “holes” (more formally, " { $emphasis "fry specifiers" } "), and the holes are filled in when the fried quotation is pushed on the stack." $nl "Fried quotations are started by a special parsing word:" -{ $subsections postpone\ '[ } +{ $subsections postpone\ $[ } "There are two types of fry specifiers; the first can hold a value, and the second “splices” a quotation, as if it were inserted without surrounding brackets:" { $subsections _ diff --git a/core/fry/fry-tests.factor b/core/fry/fry-tests.factor index dc77863673..9b73a0053b 100644 --- a/core/fry/fry-tests.factor +++ b/core/fry/fry-tests.factor @@ -6,85 +6,85 @@ IN: fry.tests SYMBOLS: a b c d e f g h ; -{ [ ] } [ '[ ] ] unit-test -{ [ + ] } [ '[ + ] ] unit-test -{ [ 1 ] } [ 1 '[ _ ] ] unit-test -{ [ 1 ] } [ [ 1 ] '[ @ ] ] unit-test -{ [ 1 2 ] } [ [ 1 ] [ 2 ] '[ @ @ ] ] unit-test +{ [ ] } [ $[ ] ] unit-test +{ [ + ] } [ $[ + ] ] unit-test +{ [ 1 ] } [ 1 $[ _ ] ] unit-test +{ [ 1 ] } [ [ 1 ] $[ @ ] ] unit-test +{ [ 1 2 ] } [ [ 1 ] [ 2 ] $[ @ @ ] ] unit-test -{ [ 1 2 a ] } [ 1 2 '[ _ _ a ] ] unit-test -{ [ 1 2 ] } [ 1 2 '[ _ _ ] ] unit-test -{ [ a 1 2 ] } [ 1 2 '[ a _ _ ] ] unit-test -{ [ 1 2 a ] } [ [ 1 ] [ 2 ] '[ @ @ a ] ] unit-test -{ [ 1 a 2 b ] } [ 1 2 '[ _ a _ b ] ] unit-test -{ [ 1 a 2 b ] } [ 1 [ 2 ] '[ _ a @ b ] ] unit-test -{ [ a 1 b ] } [ 1 '[ a _ b ] ] unit-test +{ [ 1 2 a ] } [ 1 2 $[ _ _ a ] ] unit-test +{ [ 1 2 ] } [ 1 2 $[ _ _ ] ] unit-test +{ [ a 1 2 ] } [ 1 2 $[ a _ _ ] ] unit-test +{ [ 1 2 a ] } [ [ 1 ] [ 2 ] $[ @ @ a ] ] unit-test +{ [ 1 a 2 b ] } [ 1 2 $[ _ a _ b ] ] unit-test +{ [ 1 a 2 b ] } [ 1 [ 2 ] $[ _ a @ b ] ] unit-test +{ [ a 1 b ] } [ 1 $[ a _ b ] ] unit-test -{ [ a 1 b ] } [ [ 1 ] '[ a @ b ] ] unit-test -{ [ a 1 2 ] } [ [ 1 ] [ 2 ] '[ a @ @ ] ] unit-test +{ [ a 1 b ] } [ [ 1 ] $[ a @ b ] ] unit-test +{ [ a 1 2 ] } [ [ 1 ] [ 2 ] $[ a @ @ ] ] unit-test -{ [ a [ 1 ] b ] } [ 1 '[ a [ _ ] b ] ] unit-test -{ [ a 1 b [ c 2 d ] e 3 f ] } [ 1 2 3 '[ a _ b [ c _ d ] e _ f ] ] unit-test -{ [ a 1 b [ c 2 d [ e 3 f ] ] g 4 h ] } [ 1 2 3 4 '[ a _ b [ c _ d [ e _ f ] ] g _ h ] ] unit-test -{ [ a 1 b [ [ c 2 d ] e 3 f ] g 4 h ] } [ 1 2 3 4 '[ a _ b [ [ c _ d ] e _ f ] g _ h ] ] unit-test +{ [ a [ 1 ] b ] } [ 1 $[ a [ _ ] b ] ] unit-test +{ [ a 1 b [ c 2 d ] e 3 f ] } [ 1 2 3 $[ a _ b [ c _ d ] e _ f ] ] unit-test +{ [ a 1 b [ c 2 d [ e 3 f ] ] g 4 h ] } [ 1 2 3 4 $[ a _ b [ c _ d [ e _ f ] ] g _ h ] ] unit-test +{ [ a 1 b [ [ c 2 d ] e 3 f ] g 4 h ] } [ 1 2 3 4 $[ a _ b [ [ c _ d ] e _ f ] g _ h ] ] unit-test -{ [ 3 + ] } [ 3 '[ _ + ] ] unit-test +{ [ 3 + ] } [ 3 $[ _ + ] ] unit-test -{ [ 1 3 + ] } [ 1 3 '[ _ _ + ] ] unit-test +{ [ 1 3 + ] } [ 1 3 $[ _ _ + ] ] unit-test -{ [ 1 + ] } [ 1 [ + ] '[ _ @ ] ] unit-test +{ [ 1 + ] } [ 1 [ + ] $[ _ @ ] ] unit-test -{ [ 1 + . ] } [ 1 [ + ] '[ _ @ . ] ] unit-test +{ [ 1 + . ] } [ 1 [ + ] $[ _ @ . ] ] unit-test -{ [ + - ] } [ [ + ] [ - ] '[ @ @ ] ] unit-test +{ [ + - ] } [ [ + ] [ - ] $[ @ @ ] ] unit-test { [ "a" write "b" print ] } -[ "a" "b" '[ _ write _ print ] ] unit-test +[ "a" "b" $[ _ write _ print ] ] unit-test { 1/2 } [ - 1 '[ [ _ ] dip / ] 2 swap call + 1 $[ [ _ ] dip / ] 2 swap call ] unit-test { { { 1 "a" "A" } { 1 "b" "B" } { 1 "c" "C" } } } [ - 1 '[ [ _ ] 2dip 3array ] + 1 $[ [ _ ] 2dip 3array ] { "a" "b" "c" } { "A" "B" "C" } rot 2map ] unit-test { { { 1 "a" } { 1 "b" } { 1 "c" } } } [ - '[ [ 1 ] dip 2array ] + $[ [ 1 ] dip 2array ] { "a" "b" "c" } swap map ] unit-test { { { 1 "a" 2 } { 1 "b" 2 } { 1 "c" 2 } } } [ - 1 2 '[ [ _ ] dip _ 3array ] + 1 2 $[ [ _ ] dip _ 3array ] { "a" "b" "c" } swap map ] unit-test -: funny-dip ( obj quot -- ) '[ [ @ ] dip ] call ; inline +: funny-dip ( obj quot -- ) $[ [ @ ] dip ] call ; inline { "hi" 3 } [ "h" "i" 3 [ append ] funny-dip ] unit-test { { 1 2 3 } } [ - 3 1 '[ _ iota [ _ + ] map ] call + 3 1 $[ _ iota [ _ + ] map ] call ] unit-test { { 1 { 2 { 3 } } } } [ - 1 2 3 '[ _ [ _ [ _ 1array ] call 2array ] call 2array ] call + 1 2 3 $[ _ [ _ [ _ 1array ] call 2array ] call 2array ] call ] unit-test -{ 1 1 } [ '[ [ [ _ ] ] ] ] must-infer-as +{ 1 1 } [ $[ [ [ _ ] ] ] ] must-infer-as { { { { 3 } } } } [ - 3 '[ [ [ _ 1array ] call 1array ] call 1array ] call + 3 $[ [ [ _ 1array ] call 1array ] call 1array ] call ] unit-test { { { { 3 } } } } [ - 3 '[ [ [ _ 1array ] call 1array ] call 1array ] call + 3 $[ [ [ _ 1array ] call 1array ] call 1array ] call ] unit-test -[ "USING: fry locals.backend ; f '[ load-local _ ]" eval( -- quot ) ] +[ "USING: fry locals.backend ; f $[ load-local _ ]" eval( -- quot ) ] [ error>> >r/r>-in-fry-error? ] must-fail-with { { { "a" 1 } { "b" 2 } { "c" 3 } { "d" 4 } } } [ - 1 2 3 4 '[ "a" _ 2array "b" _ 2array "c" _ 2array "d" _ 2array 4array ] call + 1 2 3 4 $[ "a" _ 2array "b" _ 2array "c" _ 2array "d" _ 2array 4array ] call ] unit-test diff --git a/core/generalizations/generalizations-tests.factor b/core/generalizations/generalizations-tests.factor index 360c3e5dbe..1f77e3242b 100644 --- a/core/generalizations/generalizations-tests.factor +++ b/core/generalizations/generalizations-tests.factor @@ -30,9 +30,9 @@ IN: generalizations.tests { 1 2 3 4 } [ 2 3 4 [ 1 ] 3 ndip ] unit-test [ 1 2 3 4 5 [ drop drop drop drop drop 2 ] 5 nkeep ] must-infer -[ 1 2 3 4 5 2 '[ drop drop drop drop drop _ ] 5 nkeep ] must-infer +[ 1 2 3 4 5 2 $[ drop drop drop drop drop _ ] 5 nkeep ] must-infer { 2 1 2 3 4 5 } [ 1 2 3 4 5 [ drop drop drop drop drop 2 ] 5 nkeep ] unit-test -{ 2 1 2 3 4 5 } [ 1 2 3 4 5 2 '[ drop drop drop drop drop _ ] 5 nkeep ] unit-test +{ 2 1 2 3 4 5 } [ 1 2 3 4 5 2 $[ drop drop drop drop drop _ ] 5 nkeep ] unit-test { [ 1 2 3 + ] } [ 1 2 3 [ + ] 3 ncurry ] unit-test { "HELLO" } [ "hello" [ >upper ] 1 napply ] unit-test @@ -66,7 +66,7 @@ IN: generalizations.tests { 1 2 3 4 1 2 3 } [ nover-test ] unit-test -[ '[ number>string _ append ] 4 napply ] must-infer +[ $[ number>string _ append ] 4 napply ] must-infer { 6 8 10 12 } [ 1 2 3 4 diff --git a/core/generalizations/generalizations.factor b/core/generalizations/generalizations.factor index 917df25ab8..ba74c8d5b7 100644 --- a/core/generalizations/generalizations.factor +++ b/core/generalizations/generalizations.factor @@ -15,7 +15,7 @@ COMPILE< ALIAS: n*quot (n*quot) ; MACRO: call-n ( n -- quot ) - [ call ] '[ _ cleave ] ; + [ call ] $[ _ cleave ] ; : repeat ( n obj quot -- ) swapd times ; inline @@ -30,36 +30,36 @@ MACRO: npick ( n -- quot ) { { [ dup 0 <= ] [ nonpositive-npick ] } { [ dup 1 = ] [ drop [ dup ] ] } - [ 1 - [ dup ] [ '[ _ dip swap ] ] repeat ] + [ 1 - [ dup ] [ $[ _ dip swap ] ] repeat ] } cond ; MACRO: nover ( n -- quot ) - dup 1 + '[ _ npick ] n*quot ; + dup 1 + $[ _ npick ] n*quot ; : ndup ( n -- ) - [ '[ _ npick ] ] keep call-n ; inline + [ $[ _ npick ] ] keep call-n ; inline MACRO: dupn ( n -- quot ) [ [ drop ] ] [ 1 - [ dup ] n*quot ] if-zero ; MACRO: nrot ( n -- quot ) - 1 - [ ] [ '[ _ dip swap ] ] repeat ; + 1 - [ ] [ $[ _ dip swap ] ] repeat ; MACRO: -nrot ( n -- quot ) - 1 - [ ] [ '[ swap _ dip ] ] repeat ; + 1 - [ ] [ $[ swap _ dip ] ] repeat ; : ndrop ( n -- ) [ drop ] swap call-n ; inline : nnip ( n -- ) - '[ _ ndrop ] dip ; inline + $[ _ ndrop ] dip ; inline : ndip ( n -- ) [ [ dip ] curry ] swap call-n call ; inline : nkeep ( n -- ) - dup '[ [ _ ndup ] dip _ ndip ] call ; inline + dup $[ [ _ ndup ] dip _ ndip ] call ; inline : ncurry ( n -- ) [ curry ] swap call-n ; inline @@ -71,7 +71,7 @@ MACRO: -nrot ( n -- quot ) [ nip nkeep ] [ drop nip call ] 3bi ; inline MACRO: ncleave ( quots n -- quot ) - [ '[ _ '[ _ _ nkeep ] ] map [ ] join ] [ '[ _ ndrop ] ] bi + [ $[ _ $[ _ _ nkeep ] ] map [ ] join ] [ $[ _ ndrop ] ] bi compose ; MACRO: nspread ( quots n -- quot ) @@ -79,12 +79,12 @@ MACRO: nspread ( quots n -- quot ) [ [ but-last ] dip ] [ [ last ] dip ] 2bi swap - '[ [ _ _ nspread ] _ ndip @ ] + $[ [ _ _ nspread ] _ ndip @ ] ] if ; MACRO: spread* ( n -- quot ) [ [ ] ] [ - [1,b) [ '[ [ [ _ ndip ] curry ] dip compose ] ] map [ ] concat-as + [1,b) [ $[ [ [ _ ndip ] curry ] dip compose ] ] map [ ] concat-as [ call ] compose ] if-zero ; @@ -93,7 +93,7 @@ MACRO: nspread* ( m n -- quot ) [ * 0 ] [ drop neg ] 2bi rest >array dup length iota [ - '[ [ [ _ ndip ] curry ] _ ndip ] + $[ [ [ _ ndip ] curry ] _ ndip ] ] 2map dup rest-slice [ [ compose ] compose ] map! drop [ ] concat-as [ call ] compose ] if-zero ; @@ -119,14 +119,14 @@ MACRO: cleave* ( n -- quot ) [ [curry] ] swap [ napply ] [ spread* ] bi ; inline MACRO: mnswap ( m n -- quot ) - 1 + '[ _ -nrot ] swap '[ _ _ napply ] ; + 1 + $[ _ -nrot ] swap $[ _ _ napply ] ; MACRO: nweave ( n -- quot ) - [ dup iota [ '[ _ _ mnswap ] ] with map ] keep - '[ _ _ ncleave ] ; + [ dup iota [ $[ _ _ mnswap ] ] with map ] keep + $[ _ _ ncleave ] ; : nbi-curry ( n -- ) [ bi-curry ] swap call-n ; inline MACRO: map-compose ( quots quot -- quot' ) - '[ _ compose ] map '[ _ ] ; + $[ _ compose ] map $[ _ ] ; diff --git a/core/grouping/grouping.factor b/core/grouping/grouping.factor index 358fb104e2..dba15e1a77 100644 --- a/core/grouping/grouping.factor +++ b/core/grouping/grouping.factor @@ -63,7 +63,7 @@ M: clumps group@ PRIVATE< : map-like ( seq n quot -- seq ) - 2keep drop '[ _ like ] map ; inline + 2keep drop $[ _ like ] map ; inline PRIVATE> @@ -77,7 +77,7 @@ PRIVATE> [ first2-unsafe ] dip call ] [ [ [ first-unsafe 1 ] [ (setup-each) ] bi ] dip - '[ @ _ keep swap ] (all-integers?) nip + $[ @ _ keep swap ] (all-integers?) nip ] if ] if ; inline diff --git a/core/hash-sets/hash-sets-tests.factor b/core/hash-sets/hash-sets-tests.factor index 46dc06849f..2b65f13514 100644 --- a/core/hash-sets/hash-sets-tests.factor +++ b/core/hash-sets/hash-sets-tests.factor @@ -49,7 +49,7 @@ sets sorting tools.test ; { t } [ 100 iota [ [ ] map ] - [ [ HS{ } clone [ '[ _ adjoin ] each-integer ] keep ] map ] bi + [ [ HS{ } clone [ $[ _ adjoin ] each-integer ] keep ] map ] bi [ [ array>> length ] bi@ = ] 2all? ] unit-test diff --git a/core/hashtables/hashtables-tests.factor b/core/hashtables/hashtables-tests.factor index 92295244bd..c948b2997c 100644 --- a/core/hashtables/hashtables-tests.factor +++ b/core/hashtables/hashtables-tests.factor @@ -146,7 +146,7 @@ H{ } "x" set { t } [ 100 iota [ [ ] map ] - [ [ H{ } clone [ '[ dup _ set-at ] each-integer ] keep ] map ] bi + [ [ H{ } clone [ $[ dup _ set-at ] each-integer ] keep ] map ] bi [ [ array>> length ] bi@ = ] 2all? ] unit-test diff --git a/core/hints/hints.factor b/core/hints/hints.factor index 50b034dc6d..5142fbbea4 100644 --- a/core/hints/hints.factor +++ b/core/hints/hints.factor @@ -12,7 +12,7 @@ GENERIC: specializer-predicate ( spec -- quot ) ; M: class specializer-predicate predicate-def ; -M: object specializer-predicate '[ _ eq? ] ; +M: object specializer-predicate $[ _ eq? ] ; GENERIC: specializer-declaration ( spec -- class ) ; @@ -35,7 +35,7 @@ M: object specializer-declaration class-of ; : specializer-cases ( quot specializer -- alist ) dup [ array? ] all? [ 1array ] unless [ [ nip make-specializer ] - [ [ specializer-declaration ] map swap '[ _ declare @ ] ] 2bi + [ [ specializer-declaration ] map swap $[ _ declare @ ] ] 2bi ] with { } map>assoc ; : specialize-quot ( quot specializer -- quot' ) diff --git a/core/io/files/files-tests.factor b/core/io/files/files-tests.factor index f6e238b271..b26c018e4e 100644 --- a/core/io/files/files-tests.factor +++ b/core/io/files/files-tests.factor @@ -274,7 +274,7 @@ CONSTANT: pt-array-1 [ "resource:core" normalize-path [ cwd = ] [ cd ] [ cwd = ] tri - ] cwd '[ _ dup cd cwd = ] [ ] cleanup + ] cwd $[ _ dup cd cwd = ] [ ] cleanup ] unit-test { t } [ diff --git a/core/locals/fry/fry.factor b/core/locals/fry/fry.factor index 4e112830e9..552b64d95e 100644 --- a/core/locals/fry/fry.factor +++ b/core/locals/fry/fry.factor @@ -11,7 +11,7 @@ M: lambda count-inputs body>> count-inputs ; M: lambda fry clone [ [ count-inputs ] [ fry ] bi ] change-body - [ [ vars>> length ] keep '[ _ _ mnswap _ call ] ] + [ [ vars>> length ] keep $[ _ _ mnswap _ call ] ] [ drop [ncurry] curry [ call ] compose ] 2bi ; M: let fry diff --git a/core/locals/locals-docs.factor b/core/locals/locals-docs.factor index 29ac5dd130..be3ab34190 100644 --- a/core/locals/locals-docs.factor +++ b/core/locals/locals-docs.factor @@ -217,7 +217,7 @@ ARTICLE: "locals-fry" "Lexical variables and fry" "Lexical variables integrate with " { $link "fry" } " so that mixing variables with fried quotations gives intuitive results." $nl "The following two code snippets are equivalent:" -{ $code "'[ sq _ + ]" } +{ $code "$[ sq _ + ]" } { $code "[ [ sq ] dip + ] curry" } "The semantics of " { $link dip } " and " { $link curry } " are such that the first example behaves as if the top of the stack as “inserted” in the “hole” in the quotation's second element." $nl @@ -228,8 +228,8 @@ $nl { $code "3 |[ a b | a b - ] curry" } { $code "|[ a | a 3 - ]" } "Because of this, the behavior of " { $snippet "fry" } " changes when applied to such a quotation to ensure that fry conceptually behaves the same as with normal quotations, placing the fried values “underneath” the variable bindings. Thus, the following snippets are no longer equivalent:" -{ $code "'[ |[ a | _ a - ] ]" } -{ $code "'[ |[ a | a - ] curry ] call" } +{ $code "$[ |[ a | _ a - ] ]" } +{ $code "$[ |[ a | a - ] curry ] call" } "Instead, the first line above expands into something like the following:" { $code "[ [ swap |[ a | a - ] ] curry call ]" } $nl @@ -241,7 +241,7 @@ ARTICLE: "locals-limitations" "Limitations of lexical variables" "The expansion of a macro cannot reference lexical variables bound in the outer scope. For example, the following macro is invalid:" { $code "MACRO:: twice ( quot -- ) [ quot call quot call ] ;" } "The following is fine, though:" -{ $code "MACRO:: twice ( quot -- ) quot quot '[ @ @ ] ;" } +{ $code "MACRO:: twice ( quot -- ) quot quot $[ @ @ ] ;" } { $heading "Static stack effect inference and macros" } "A macro will only expand at compile-time if all of its inputs are literal. Likewise, the word containing the macro will only have a static stack effect and compile successfully if the macro's inputs are literal. When lexical variables are used in a macro's literal arguments, there is an additional restriction: The literals must immediately precede the macro call lexically." $nl diff --git a/core/locals/locals-tests.factor b/core/locals/locals-tests.factor index bf56dc9b1b..48a8250539 100644 --- a/core/locals/locals-tests.factor +++ b/core/locals/locals-tests.factor @@ -388,7 +388,7 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { 10 } [ 10 |[ A | { [ A ] } ] call first call ] unit-test [ - "USING: locals fry math ; 1 '[ let[ 10 :> A A _ + ] ]" + "USING: locals fry math ; 1 $[ let[ 10 :> A A _ + ] ]" eval( -- ) call ] [ error>> >r/r>-in-fry-error? ] must-fail-with @@ -431,31 +431,31 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { 3 } [ 2 |[ | :> a! a 1 + a! a ] call ] unit-test : fry-locals-test-1 ( -- n ) - let[ 6 '[ let[ 4 :> A A _ + ] ] call ] ; + let[ 6 $[ let[ 4 :> A A _ + ] ] call ] ; \ fry-locals-test-1 def>> must-infer { 10 } [ fry-locals-test-1 ] unit-test :: fry-locals-test-2 ( -- n ) - let[ 6 '[ let[ 4 :> A A _ + ] ] call ] ; + let[ 6 $[ let[ 4 :> A A _ + ] ] call ] ; \ fry-locals-test-2 def>> must-infer { 10 } [ fry-locals-test-2 ] unit-test -{ 1 } [ 3 4 |[ | '[ [ _ swap - ] call ] call ] call ] unit-test +{ 1 } [ 3 4 |[ | $[ [ _ swap - ] call ] call ] call ] unit-test { -1 } [ 3 4 |[ | |[ a | a - ] call ] call ] unit-test { -1 } [ 3 4 |[ | |[ a | a - ] curry call ] call ] unit-test { -1 } [ 3 4 |[ a | a - ] curry call ] unit-test -{ 1 } [ 3 4 |[ | '[ |[ a | _ a - ] call ] call ] call ] unit-test -{ -1 } [ 3 4 |[ | '[ |[ a | a _ - ] call ] call ] call ] unit-test +{ 1 } [ 3 4 |[ | $[ |[ a | _ a - ] call ] call ] call ] unit-test +{ -1 } [ 3 4 |[ | $[ |[ a | a _ - ] call ] call ] call ] unit-test { { 1 2 3 4 } } [ 1 3 2 4 - |[ | '[ |[ a b | a _ b _ 4array ] call ] call ] call + |[ | $[ |[ a b | a _ b _ 4array ] call ] call ] call ] unit-test { 10 } [ - |[ | 0 '[ let[ 10 :> A A _ + ] ] call ] call + |[ | 0 $[ let[ 10 :> A A _ + ] ] call ] call ] unit-test ! littledan found this problem @@ -475,7 +475,7 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; { 3 } [ 3 t erg's-:>-bug ] unit-test -:: erg's-:>-bug-2 ( n ? -- n ) ? n '[ _ :> n n ] [ n :> b b ] if ; +:: erg's-:>-bug-2 ( n ? -- n ) ? n $[ _ :> n n ] [ n :> b b ] if ; { 3 } [ 3 f erg's-:>-bug-2 ] unit-test diff --git a/core/locals/parser/parser.factor b/core/locals/parser/parser.factor index fc2274706a..14dae44992 100644 --- a/core/locals/parser/parser.factor +++ b/core/locals/parser/parser.factor @@ -32,7 +32,7 @@ ERROR: invalid-local-name name ; SINGLETON: lambda-parser : with-lambda-scope ( assoc reader-quot: ( -- quot ) -- quot ) - '[ + $[ in-lambda? on lambda-parser quotation-parser set use-words @ diff --git a/core/locals/rewrite/point-free/point-free.factor b/core/locals/rewrite/point-free/point-free.factor index cbea6c299f..c26fd714b7 100644 --- a/core/locals/rewrite/point-free/point-free.factor +++ b/core/locals/rewrite/point-free/point-free.factor @@ -9,7 +9,7 @@ IN: locals.rewrite.point-free ! retain stack manipulation : local-index ( args obj -- n ) - 2dup '[ unquote _ eq? ] find drop + 2dup $[ unquote _ eq? ] find drop [ 2nip ] [ bad-local ] if* ; : read-local-quot ( args obj -- quot ) diff --git a/core/locals/rewrite/sugar/sugar.factor b/core/locals/rewrite/sugar/sugar.factor index c396bc57e5..8376e84b06 100644 --- a/core/locals/rewrite/sugar/sugar.factor +++ b/core/locals/rewrite/sugar/sugar.factor @@ -53,7 +53,7 @@ GENERIC: rewrite-element ( obj -- ) ; [ rewrite-element ] each ; : rewrite-sequence ( seq -- ) - [ rewrite-elements ] [ length ] [ 0 head ] tri '[ _ _ nsequence ] % ; + [ rewrite-elements ] [ length ] [ 0 head ] tri $[ _ _ nsequence ] % ; M: array rewrite-element dup rewrite-literal? [ rewrite-sequence ] [ , ] if ; @@ -66,7 +66,7 @@ M: hashtable rewrite-element M: tuple rewrite-element dup rewrite-literal? [ - [ tuple-slots rewrite-elements ] [ class-of ] bi '[ _ boa ] % + [ tuple-slots rewrite-elements ] [ class-of ] bi $[ _ boa ] % ] [ , ] if ; M: quotation rewrite-element rewrite-sugar* ; diff --git a/core/macros/expander/expander.factor b/core/macros/expander/expander.factor index 36b2984f88..1db3de2328 100644 --- a/core/macros/expander/expander.factor +++ b/core/macros/expander/expander.factor @@ -40,16 +40,16 @@ M: wrapper expand-macros* wrapped>> literal ; : expand-dispatch ( -- ) stack get pop end - [ [ expand-macros ] [ ] map-as '[ _ dip ] % ] + [ [ expand-macros ] [ ] map-as $[ _ dip ] % ] [ length iota [ ] keep - [ '[ _ ndrop _ nnip call ] [ ] like ] 2map , \ dispatch , + [ $[ _ ndrop _ nnip call ] [ ] like ] 2map , \ dispatch , ] bi ; : word, ( word -- ) end , ; : expand-macro ( word quot -- ) - '[ + $[ drop stack [ _ with-datastack >vector ] change stack get pop >quotation end diff --git a/core/macros/macros-docs.factor b/core/macros/macros-docs.factor index 70337b547e..1eb64f1f43 100644 --- a/core/macros/macros-docs.factor +++ b/core/macros/macros-docs.factor @@ -18,7 +18,7 @@ HELP: \ MACRO: { $code "USING: fry generalizations kernel macros stack-checker ;" "MACRO: preserving ( quot -- quot' )" - " [ inputs ] keep '[ _ ndup @ ] ;" + " [ inputs ] keep $[ _ ndup @ ] ;" } "Using this macro, we can define a variant of " { $link if } " which takes a predicate quotation instead of a boolean; any values consumed by the predicate quotation are restored immediately after:" { $code diff --git a/core/macros/macros.factor b/core/macros/macros.factor index db5e5b4a20..996c287cfe 100644 --- a/core/macros/macros.factor +++ b/core/macros/macros.factor @@ -19,8 +19,8 @@ PRIVATE> { [ nip check-macro-effect ] [ - [ '[ _ _ call-effect ] ] keep - [ memoize-quot '[ @ call ] ] keep + [ $[ _ _ call-effect ] ] keep + [ memoize-quot $[ @ call ] ] keep define-declared ] [ drop "macro" set-word-prop ] diff --git a/core/make/make-docs.factor b/core/make/make-docs.factor index fa797aecf4..c52f81eb79 100644 --- a/core/make/make-docs.factor +++ b/core/make/make-docs.factor @@ -34,7 +34,7 @@ $nl "For example," { $code "[ 2 , , \\ + , ] [ ] make" } "is better expressed as" -{ $code "'[ 2 _ + ]" } ; +{ $code "$[ 2 _ + ]" } ; ARTICLE: "namespaces-make" "Making sequences with variables" "The " { $vocab-link "make" } " vocabulary implements a facility for constructing " { $link sequence } "s and " { $link assoc } "s by holding a collector object in a variable. Storing the collector object in a variable rather than the stack may allow code to be written with less stack manipulation." diff --git a/core/memoize/memoize.factor b/core/memoize/memoize.factor index f46fa297c5..c42b78c7a2 100644 --- a/core/memoize/memoize.factor +++ b/core/memoize/memoize.factor @@ -13,7 +13,7 @@ PRIVATE< [ ] concat-as ; : [nsequence] ( length exemplar -- quot ) - [ [ [ 1 - ] keep ] dip '[ _ _ _ new-sequence ] ] + [ [ [ 1 - ] keep ] dip $[ _ _ _ new-sequence ] ] [ drop [ [ set-nth-unsafe ] 2keep [ 1 - ] dip ] (n*quot) ] 2bi [ nip ] 3append ; @@ -40,11 +40,11 @@ PRIVATE< [ in>> unpacker ] [ out>> packer ] bi surround ; : make/n ( table quot effect -- quot ) - [ unpack/pack '[ _ _ cache ] ] keep pack/unpack ; + [ unpack/pack $[ _ _ cache ] ] keep pack/unpack ; : make/0 ( table quot effect -- quot ) out>> [ - packer '[ + packer $[ _ dup first-unsafe [ nip ] [ @ @ [ 0 rot set-nth-unsafe ] keep ] if* ] @@ -57,7 +57,7 @@ PRIVATE> : (define-memoized) ( word quot effect hashtable -- ) [ [ drop "memo-quot" set-word-prop ] ] dip - '[ 2drop _ "memoize" set-word-prop ] + $[ 2drop _ "memoize" set-word-prop ] [ [ [ dup "memoize" word-prop ] 2dip make-memoizer ] keep define-declared ] 3tri ; diff --git a/core/modern/lexer/lexer.factor b/core/modern/lexer/lexer.factor index b835d4a098..87ff1cf3a3 100644 --- a/core/modern/lexer/lexer.factor +++ b/core/modern/lexer/lexer.factor @@ -41,7 +41,7 @@ ERROR: unexpected-end n string ; :: slice-til-either ( n string tokens -- n'/f string slice/f ch/f ) n [ - n string '[ tokens member? ] find-from + n string $[ tokens member? ] find-from dup "\s\r\n" member? [ :> ( n' ch ) n' string @@ -74,7 +74,7 @@ ERROR: unexpected-end n string ; :: slice-til-separator-inclusive ( n string tokens -- n' string slice/f ch/f ) - n string '[ tokens member? ] find-from [ dup [ 1 + ] when ] dip :> ( n' ch ) + n string $[ tokens member? ] find-from [ dup [ 1 + ] when ] dip :> ( n' ch ) n' string n n' string ? ch ; inline @@ -126,11 +126,11 @@ ERROR: unexpected-end n string ; [ lex-til-whitespace drop 2nip ] dip merge-slices ; : peek-merge-til-whitespace ( lexer slice -- slice' ) - '[ _ merge-lex-til-whitespace ] with-lexer-rollback ; + $[ _ merge-lex-til-whitespace ] with-lexer-rollback ; :: slice-til-eol ( n string -- n'/f string slice/f ch/f ) n [ - n string '[ "\r\n" member? ] find-from :> ( n' ch ) + n string $[ "\r\n" member? ] find-from :> ( n' ch ) n' string n n' string ? ch diff --git a/core/modern/modern.factor b/core/modern/modern.factor index ecfa7e832b..759b011690 100644 --- a/core/modern/modern.factor +++ b/core/modern/modern.factor @@ -186,7 +186,7 @@ ERROR: no-start-delimiter lexer opening ; nip matching-delimiter-string 1array ] [ matching-delimiter-string [ append ] [ nip ] 2bi 2array - ] if closing '[ _ sequence= ] any? ; + ] if closing $[ _ sequence= ] any? ; ERROR: whitespace-expected-after n string ch ; @@ -300,7 +300,7 @@ ERROR: lex-expected-but-got-eof lexer tags ; ERROR: unnestable-form n string obj ; ! For implementing [ { ( : lex-until ( lexer tags -- payload closing ) - '[ + $[ [ _ lex-factor [ dup tag-literal? [ @@ -324,7 +324,7 @@ MACRO:: read-matched ( ch -- quot: ( lexer tag -- slice' ) ) over lexer-nth-check-eof { { [ dup openstreq member? ] [ ch read-double-matched ] } ! (=( or (( { [ dup blank? ] [ - drop dup '[ + drop dup $[ _ matching-delimiter-string closestr1 2dup = [ drop 1array ] [ 2array ] if lex-until ] dip 1 cut-slice* single-matched-literal make-matched-literal @@ -524,7 +524,7 @@ MACRO: rules>call-lexer ( seq -- quot: ( lexer string -- literal ) ) lexer-rules>assoc { f [ nip f like dup [ make-tag-literal ] when ] } suffix ] bi - '[ dup _ lex-til-either [ 2drop ] 2dip _ case ] ; + $[ dup _ lex-til-either [ 2drop ] 2dip _ case ] ; CONSTANT: factor-lexing-rules { T{ line-comment-lexer { generator read-exclamation } { delimiter char: \! } } @@ -554,7 +554,7 @@ CONSTANT: factor-lexing-rules { factor-lexing-rules rules>call-lexer ; : string>literals ( string -- sequence ) - '[ _ lex-factor ] loop>array postprocess-lexed ; + $[ _ lex-factor ] loop>array postprocess-lexed ; : path>literals ( path -- sequence ) utf8 file-contents string>literals ; diff --git a/core/modern/out/out-tests.factor b/core/modern/out/out-tests.factor index 04a85802c4..d4f1975ad1 100644 --- a/core/modern/out/out-tests.factor +++ b/core/modern/out/out-tests.factor @@ -46,7 +46,7 @@ IN: modern.out.tests ![[ { ": asdf < '< > > ;" } [ - ": asdf [ '[ ] ] ;" [ + ": asdf [ $[ ] ] ;" [ dup { [ single-matched-literal? ] [ delimiter>> "[" = ] } 1&& [ [ drop "<" ] change-delimiter ] when ] rewrite-string diff --git a/core/modern/out/out.factor b/core/modern/out/out.factor index 5073bd0d31..e555609707 100644 --- a/core/modern/out/out.factor +++ b/core/modern/out/out.factor @@ -132,7 +132,7 @@ M: line-comment-literal write-literal ] [ seq>> 3 swap ?nth - [ tag>> length 1 + last-slice swap '[ _ modify-to ] change ] when* + [ tag>> length 1 + last-slice swap $[ _ modify-to ] change ] when* ] } cleave ; @@ -201,7 +201,7 @@ M: compound-sequence-literal write-literal : map-literals ( obj quot: ( obj -- obj' ) -- seq ) over single-matched-literal? [ [ call drop ] [ - '[ + $[ dup compound-sequence-literal? [ sequence>> ] when [ _ map-literals ] map ] change-payload @@ -212,14 +212,14 @@ M: compound-sequence-literal write-literal : rewrite-path ( path quot -- ) ! dup print - '[ [ path>literals [ _ map-literals ] map ] [ ] bi write-modern-path ] + $[ [ path>literals [ _ map-literals ] map ] [ ] bi write-modern-path ] [ drop . ] recover ; inline : rewrite-string ( string quot -- ) ! dup print - [ string>literals ] dip '[ _ map-literals ] map write-modern-string ; inline + [ string>literals ] dip $[ _ map-literals ] map write-modern-string ; inline -: rewrite-paths ( seq quot -- ) '[ _ rewrite-path ] each ; inline +: rewrite-paths ( seq quot -- ) $[ _ rewrite-path ] each ; inline : paren-word>tick-word ( string -- string' ) diff --git a/core/modern/slices/slices.factor b/core/modern/slices/slices.factor index bd329449b2..58155f44df 100644 --- a/core/modern/slices/slices.factor +++ b/core/modern/slices/slices.factor @@ -92,7 +92,7 @@ ERROR: unexpected-end n string ; :: slice-til-eol ( n string -- n' string slice/f ch/f ) n [ - n string '[ "\r\n" member? ] find-from :> ( n' ch ) + n string $[ "\r\n" member? ] find-from :> ( n' ch ) n' string n n' string ? ch @@ -102,7 +102,7 @@ ERROR: unexpected-end n string ; :: ((merge-slice-til-eol-slash)) ( n string -- n' string slice/f ch/f ) n [ - n string '[ "\r\n\\" member? ] find-from :> ( n' ch ) + n string $[ "\r\n\\" member? ] find-from :> ( n' ch ) n' string n n' string ? ch @@ -145,7 +145,7 @@ ERROR: unexpected-end n string ; 2dup empty-slice-from (merge-slice-til-eol-slash) ; :: slice-til-separator-inclusive ( n string tokens -- n' string slice/f ch/f ) - n string '[ tokens member? ] find-from [ dup [ 1 + ] when ] dip :> ( n' ch ) + n string $[ tokens member? ] find-from [ dup [ 1 + ] when ] dip :> ( n' ch ) n' string n n' string ? ch ; inline @@ -157,7 +157,7 @@ ERROR: unexpected-end n string ; :: slice-til-either ( n string tokens -- n'/f string slice/f ch ) n [ - n string '[ tokens member? ] find-from + n string $[ tokens member? ] find-from dup "\s\r\n" member? [ :> ( n' ch ) n' string @@ -193,7 +193,7 @@ ERROR: char-expected-but-got-eof n string expected ; slice from>> n' string ? ; : modify-from ( slice n -- slice' ) - '[ from>> _ + ] [ to>> ] [ seq>> ] tri ; + $[ from>> _ + ] [ to>> ] [ seq>> ] tri ; : modify-to ( slice n -- slice' ) [ [ from>> ] [ to>> ] [ seq>> ] tri ] dip diff --git a/core/sequences/generalizations/generalizations.factor b/core/sequences/generalizations/generalizations.factor index d0feb06063..3561bbf8ba 100644 --- a/core/sequences/generalizations/generalizations.factor +++ b/core/sequences/generalizations/generalizations.factor @@ -5,10 +5,10 @@ memoize.private generalizations ; IN: sequences.generalizations MACRO: nsequence ( n seq -- quot ) - [ [nsequence] ] keep '[ @ _ like ] ; + [ [nsequence] ] keep $[ @ _ like ] ; MACRO: narray ( n -- quot ) - '[ _ { } nsequence ] ; + $[ _ { } nsequence ] ; MACRO: firstn-unsafe ( n -- quot ) [firstn] ; @@ -17,19 +17,19 @@ MACRO: firstn ( n -- quot ) [ [ drop ] ] [ [ 1 - swap bounds-check 2drop ] [ firstn-unsafe ] - bi-curry '[ _ _ bi ] + bi-curry $[ _ _ bi ] ] if-zero ; MACRO: set-firstn-unsafe ( n -- quot ) [ 1 + ] - [ iota [ '[ _ rot [ set-nth-unsafe ] keep ] ] map ] bi - '[ _ -nrot _ spread drop ] ; + [ iota [ $[ _ rot [ set-nth-unsafe ] keep ] ] map ] bi + $[ _ -nrot _ spread drop ] ; MACRO: set-firstn ( n -- quot ) [ [ drop ] ] [ [ 1 - swap bounds-check 2drop ] [ set-firstn-unsafe ] - bi-curry '[ _ _ bi ] + bi-curry $[ _ _ bi ] ] if-zero ; : nappend ( n -- seq ) narray concat ; inline @@ -39,7 +39,7 @@ MACRO: set-firstn ( n -- quot ) MACRO: nmin-length ( n -- quot ) dup 1 - [ min ] n*quot - '[ [ length ] _ napply @ ] ; + $[ [ length ] _ napply @ ] ; : nnth ( n seq... n -- ) [ nth ] swap [ apply-curry ] [ cleave* ] bi ; inline @@ -49,28 +49,28 @@ MACRO: nmin-length ( n -- quot ) MACRO: nset-nth-unsafe ( n -- quot ) [ [ drop ] ] - [ '[ [ set-nth-unsafe ] _ [ apply-curry ] [ cleave-curry ] [ spread* ] tri ] ] + [ $[ [ set-nth-unsafe ] _ [ apply-curry ] [ cleave-curry ] [ spread* ] tri ] ] if-zero ; : (neach) ( seq... quot n -- len quot' ) dup dup dup - '[ [ _ nmin-length ] _ nkeep [ _ nnth-unsafe ] _ ncurry ] dip compose ; inline + $[ [ _ nmin-length ] _ nkeep [ _ nnth-unsafe ] _ ncurry ] dip compose ; inline : neach ( seq... quot n -- ) (neach) each-integer ; inline : nmap-as ( seq... quot exemplar n -- result ) - '[ _ (neach) ] dip map-integers ; inline + $[ _ (neach) ] dip map-integers ; inline : nmap ( seq... quot n -- result ) - dup '[ [ _ npick ] dip swap ] dip nmap-as ; inline + dup $[ [ _ npick ] dip swap ] dip nmap-as ; inline MACRO: nnew-sequence ( n -- quot ) [ [ drop ] ] - [ dup '[ [ new-sequence ] _ apply-curry _ cleave* ] ] if-zero ; + [ dup $[ [ new-sequence ] _ apply-curry _ cleave* ] ] if-zero ; : nnew-like ( len exemplar... quot n -- result... ) - 5 dupn '[ + 5 dupn $[ _ nover [ [ _ nnew-sequence ] dip call ] _ ndip [ like ] @@ -80,23 +80,23 @@ MACRO: nnew-sequence ( n -- quot ) MACRO: (ncollect) ( n -- quot ) 3 dupn 1 + - '[ [ [ keep ] _ ndip _ nset-nth-unsafe ] _ ncurry ] ; + $[ [ [ keep ] _ ndip _ nset-nth-unsafe ] _ ncurry ] ; : ncollect ( len quot into... n -- ) (ncollect) each-integer ; inline : nmap-integers ( len quot exemplar... n -- result... ) 4 dupn - '[ [ over ] _ ndip [ [ _ ncollect ] _ nkeep ] _ nnew-like ] call ; inline + $[ [ over ] _ ndip [ [ _ ncollect ] _ nkeep ] _ nnew-like ] call ; inline : mnmap-as ( m*seq quot n*exemplar m n -- result*n ) - dup '[ [ _ (neach) ] _ ndip _ nmap-integers ] call ; inline + dup $[ [ _ (neach) ] _ ndip _ nmap-integers ] call ; inline : mnmap ( m*seq quot m n -- result*n ) - 2dup '[ [ _ npick ] dip swap _ dupn ] 2dip mnmap-as ; inline + 2dup $[ [ _ npick ] dip swap _ dupn ] 2dip mnmap-as ; inline : ncollector-as ( quot exemplar... n -- quot' vec... ) - 5 dupn '[ + 5 dupn $[ [ [ length ] keep new-resizable ] _ napply [ [ [ push ] _ apply-curry _ spread* ] _ ncurry compose ] _ nkeep ] call ; inline @@ -105,7 +105,7 @@ MACRO: (ncollect) ( n -- quot ) [ V{ } swap dupn ] keep ncollector-as ; inline : nproduce-as ( pred quot exemplar... n -- seq... ) - 7 dupn '[ + 7 dupn $[ _ ndup [ _ ncollector-as [ while ] _ ndip ] _ ncurry _ ndip @@ -116,7 +116,7 @@ MACRO: (ncollect) ( n -- quot ) [ { } swap dupn ] keep nproduce-as ; inline MACRO: nmap-reduce ( map-quot reduce-quot n -- quot ) - -rot dupd compose [ over ] dip over '[ + -rot dupd compose [ over ] dip over $[ [ [ first ] _ napply @ 1 ] _ nkeep _ _ (neach) (each-integer) ] ; @@ -125,7 +125,7 @@ MACRO: nmap-reduce ( map-quot reduce-quot n -- quot ) (neach) all-integers? ; inline MACRO: finish-nfind ( n -- quot ) - [ 1 + ] keep dup dup dup '[ + [ 1 + ] keep dup dup dup $[ _ npick [ [ dup ] _ ndip _ nnth-unsafe ] [ _ ndrop _ [ f ] times ] @@ -134,8 +134,8 @@ MACRO: finish-nfind ( n -- quot ) : (nfind) ( seqs... quot n quot' -- i elts... ) over - [ '[ _ _ (neach) @ ] ] dip - [ '[ _ finish-nfind ] ] keep + [ $[ _ _ (neach) @ ] ] dip + [ $[ _ finish-nfind ] ] keep nbi ; inline : nfind ( seqs... quot n -- i elts... ) diff --git a/core/stack-checker/alien/alien.factor b/core/stack-checker/alien/alien.factor index 955337be88..45a2260966 100644 --- a/core/stack-checker/alien/alien.factor +++ b/core/stack-checker/alien/alien.factor @@ -79,7 +79,7 @@ TUPLE: alien-callback-params < alien-node-params xt ; pop-params pop-return ! Coerce parameters to required types - dup param-prep-quot '[ _ [ >c-ptr ] bi* ] infer-quot-here + dup param-prep-quot $[ _ [ >c-ptr ] bi* ] infer-quot-here ! Magic #: consume the function pointer, too dup 1 alien-stack ! Add node to IR @@ -108,14 +108,14 @@ TUPLE: alien-callback-params < alien-node-params xt ; : callback-bottom ( params -- ) "( callback )" >>xt - xt>> '[ _ callback-xt { alien } declare ] infer-quot-here ; + xt>> $[ _ callback-xt { alien } declare ] infer-quot-here ; : callback-return-quot ( ctype -- quot ) return>> [ [ ] ] [ lookup-c-type c-type-unboxer-quot ] if-void ; : callback-parameter-quot ( params -- quot ) parameters>> [ lookup-c-type ] map - [ [ c-type-class ] map '[ _ declare ] ] + [ [ c-type-class ] map $[ _ declare ] ] [ [ c-type-boxer-quot ] map deep-spread>quot ] bi append ; @@ -128,7 +128,7 @@ wait-for-callback-hook [ [ drop ] ] initialize M: callable wrap-callback-quot swap [ callback-parameter-quot ] [ callback-return-quot ] bi surround wait-for-callback-hook get - '[ _ _ do-callback ] >quotation ; + $[ _ _ do-callback ] >quotation ; : callback-effect ( params -- effect ) [ parameters>> length "x" ] diff --git a/core/stack-checker/backend/backend.factor b/core/stack-checker/backend/backend.factor index eab881e9b5..d5e07a53b3 100644 --- a/core/stack-checker/backend/backend.factor +++ b/core/stack-checker/backend/backend.factor @@ -135,12 +135,12 @@ M: object apply-object push-literal ; consume-r dup copy-values [ nip output-d ] [ #r>, ] 2bi ; : consume/produce ( ..a effect quot: ( ..a inputs outputs -- ..b ) -- ..b ) - '[ [ in>> length consume-d ] [ out>> length produce-d ] bi @ ] + $[ [ in>> length consume-d ] [ out>> length produce-d ] bi @ ] [ terminated?>> [ terminate ] when ] bi ; inline : apply-word/effect ( word effect -- ) - swap '[ _ #call, ] consume/produce ; + swap $[ _ #call, ] consume/produce ; : end-infer ( -- ) meta-d clone #return, ; diff --git a/core/stack-checker/branches/branches.factor b/core/stack-checker/branches/branches.factor index 600d03b629..12a192f4d4 100644 --- a/core/stack-checker/branches/branches.factor +++ b/core/stack-checker/branches/branches.factor @@ -23,12 +23,12 @@ SYMBOLS: +bottom+ +top+ ; ! unify with literals. dup empty? [ dup longest length - '[ _ +bottom+ pad-head ] map + $[ _ +bottom+ pad-head ] map ] unless ; : phi-inputs ( max-input-count pairs -- newseq ) dup empty? [ nip ] [ - swap '[ [ _ ] dip first2 unify-inputs ] map + swap $[ [ _ ] dip first2 unify-inputs ] map pad-with-bottom ] if ; @@ -62,7 +62,7 @@ SYMBOLS: combinator quotations ; ] if-empty ; : branch-variable ( seq symbol -- seq ) - '[ _ of ] map ; + $[ _ of ] map ; : active-variable ( seq symbol -- seq ) [ [ terminated? over at [ drop f ] when ] map ] dip diff --git a/core/stack-checker/dependencies/dependencies.factor b/core/stack-checker/dependencies/dependencies.factor index 05a26bd69d..8b37c402f2 100644 --- a/core/stack-checker/dependencies/dependencies.factor +++ b/core/stack-checker/dependencies/dependencies.factor @@ -27,7 +27,7 @@ SYMBOLS: effect-dependency conditional-dependency definition-dependency ; : depends-on ( word how -- ) over primitive? [ 2drop ] [ dependencies get dup [ - swap '[ _ strongest-dependency ] change-at + swap $[ _ strongest-dependency ] change-at ] [ 3drop ] if ] if ; diff --git a/core/stack-checker/inlining/inlining.factor b/core/stack-checker/inlining/inlining.factor index aa92d2f859..ef6b1e55bb 100644 --- a/core/stack-checker/inlining/inlining.factor +++ b/core/stack-checker/inlining/inlining.factor @@ -128,13 +128,13 @@ M: declared-effect (undeclared-known) known>> (undeclared-known) ; : adjust-stack-effect ( effect -- effect' ) [ in>> ] [ out>> ] bi meta-d length pick length [-] - object '[ _ prepend ] bi@ + object $[ _ prepend ] bi@ ; : call-recursive-inline-word ( word label -- ) over recursive? [ [ required-stack-effect adjust-stack-effect ] dip - [ check-call ] [ '[ _ #call-recursive, ] consume/produce ] bi + [ check-call ] [ $[ _ #call-recursive, ] consume/produce ] bi ] [ drop undeclared-recursion-error inference-error ] if ; diff --git a/core/stack-checker/known-words/known-words.factor b/core/stack-checker/known-words/known-words.factor index 1cfda5b2d9..0cf51b9483 100644 --- a/core/stack-checker/known-words/known-words.factor +++ b/core/stack-checker/known-words/known-words.factor @@ -231,7 +231,7 @@ M: object infer-call* \ call bad-macro-input ; { call-effect execute-effect } [ dup t "no-compile" set-word-prop - dup '[ _ infer-call-effect ] "special" set-word-prop + dup $[ _ infer-call-effect ] "special" set-word-prop ] each \ if [ infer-if ] "special" set-word-prop @@ -254,7 +254,7 @@ M: object infer-call* \ call bad-macro-input ; set-datastack set-retainstack unwind-native-frames -} [ dup '[ _ do-not-compile ] "special" set-word-prop ] each +} [ dup $[ _ do-not-compile ] "special" set-word-prop ] each { declare call (call) dip 2dip 3dip curry compose diff --git a/core/stack-checker/stack-checker-docs.factor b/core/stack-checker/stack-checker-docs.factor index 69c58eb838..4ee9ad41e8 100644 --- a/core/stack-checker/stack-checker-docs.factor +++ b/core/stack-checker/stack-checker-docs.factor @@ -28,7 +28,7 @@ ARTICLE: "inference-combinators" "Combinator stack effects" "The following usage of " { $link map } " passes the stack checker, because the quotation is the result of " { $link curry } ":" { $example "USING: math sequences ;" "[ [ + ] curry map ] infer." "( x x -- x )" } "The equivalent code using " { $vocab-link "fry" } " and " { $vocab-link "locals" } " likewise passes the stack checker:" -{ $example "USING: fry math sequences ;" "[ '[ _ + ] map ] infer." "( x x -- x )" } +{ $example "USING: fry math sequences ;" "[ $[ _ + ] map ] infer." "( x x -- x )" } { $example "USING: locals math sequences ;" "|[ a | [ a + ] map ] infer." "( x x -- x )" } { $subheading "Defining an inline combinator" } "The following word calls a quotation twice; the word is declared " { $link postpone\ inline } ", since it invokes " { $link call } " on the result of " { $link compose } " on an input parameter:" diff --git a/core/stack-checker/transforms/transforms.factor b/core/stack-checker/transforms/transforms.factor index b5d087098f..4bd42a8e24 100644 --- a/core/stack-checker/transforms/transforms.factor +++ b/core/stack-checker/transforms/transforms.factor @@ -9,7 +9,7 @@ stack-checker.visitor words ; IN: stack-checker.transforms : call-transformer ( stack quot -- newquot ) - '[ _ _ with-datastack [ length 1 assert= ] [ first ] bi ] + $[ _ _ with-datastack [ length 1 assert= ] [ first ] bi ] [ error-continuation get current-word get transform-expansion-error ] recover ; @@ -91,35 +91,35 @@ IN: stack-checker.transforms \ spread t "no-compile" set-word-prop -\ 0&& [ '[ _ 0 n&& ] ] 1 define-transform +\ 0&& [ $[ _ 0 n&& ] ] 1 define-transform \ 0&& t "no-compile" set-word-prop -\ 1&& [ '[ _ 1 n&& ] ] 1 define-transform +\ 1&& [ $[ _ 1 n&& ] ] 1 define-transform \ 1&& t "no-compile" set-word-prop -\ 2&& [ '[ _ 2 n&& ] ] 1 define-transform +\ 2&& [ $[ _ 2 n&& ] ] 1 define-transform \ 2&& t "no-compile" set-word-prop -\ 3&& [ '[ _ 3 n&& ] ] 1 define-transform +\ 3&& [ $[ _ 3 n&& ] ] 1 define-transform \ 3&& t "no-compile" set-word-prop -\ 0|| [ '[ _ 0 n|| ] ] 1 define-transform +\ 0|| [ $[ _ 0 n|| ] ] 1 define-transform \ 0|| t "no-compile" set-word-prop -\ 1|| [ '[ _ 1 n|| ] ] 1 define-transform +\ 1|| [ $[ _ 1 n|| ] ] 1 define-transform \ 1|| t "no-compile" set-word-prop -\ 2|| [ '[ _ 2 n|| ] ] 1 define-transform +\ 2|| [ $[ _ 2 n|| ] ] 1 define-transform \ 2|| t "no-compile" set-word-prop -\ 3|| [ '[ _ 3 n|| ] ] 1 define-transform +\ 3|| [ $[ _ 3 n|| ] ] 1 define-transform \ 3|| t "no-compile" set-word-prop @@ -131,7 +131,7 @@ IN: stack-checker.transforms \ (call-next-method) [ [ add-next-method-dependency ] - [ [ next-method-quot ] [ '[ _ no-next-method ] ] bi or ] bi + [ [ next-method-quot ] [ $[ _ no-next-method ] ] bi or ] bi ] 1 define-transform \ (call-next-method) t "no-compile" set-word-prop @@ -142,7 +142,7 @@ IN: stack-checker.transforms dup tuple-layout [ add-depends-on-tuple-layout ] [ [ "boa-check" word-prop [ ] or ] dip ] 2bi - '[ @ _ ] + $[ @ _ ] ] [ \ boa time-bomb ] if diff --git a/core/stack-checker/values/values.factor b/core/stack-checker/values/values.factor index 4856ec0660..44120db748 100644 --- a/core/stack-checker/values/values.factor +++ b/core/stack-checker/values/values.factor @@ -15,7 +15,7 @@ SYMBOL: known-values known-values get at ; : set-known ( known value -- ) - '[ _ known-values get set-at ] when* ; + $[ _ known-values get set-at ] when* ; : make-known ( known -- value ) [ set-known ] keep ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index f53b4c33c9..0c0bf6b2d2 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -413,7 +413,7 @@ IN: bootstrap.syntax "|[" [ parse-lambda append! ] define-core-syntax "let[" [ parse-let append! ] define-core-syntax "MEMO[" [ parse-quotation dup infer memoize-quot suffix! ] define-core-syntax - "'[" [ parse-quotation fry append! ] define-core-syntax + "$[" [ parse-quotation fry append! ] define-core-syntax "IH{" [ \ } [ >identity-hashtable ] parse-literal ] define-core-syntax "PROTOCOL:" [ diff --git a/core/typed/namespaces/namespaces.factor b/core/typed/namespaces/namespaces.factor index 56657c2a93..b5b3e9a3c9 100644 --- a/core/typed/namespaces/namespaces.factor +++ b/core/typed/namespaces/namespaces.factor @@ -7,7 +7,7 @@ ERROR: variable-type-error variable value type ; PRIVATE< MACRO: declare1 ( type -- quot: ( value -- value ) ) - 1array '[ _ declare ] ; + 1array $[ _ declare ] ; : typed-get-unsafe ( name type -- value ) [ get ] dip declare1 ; inline diff --git a/core/typed/typed.factor b/core/typed/typed.factor index d4f50caadf..dcf300bcaf 100644 --- a/core/typed/typed.factor +++ b/core/typed/typed.factor @@ -47,7 +47,7 @@ PRIVATE< :: unboxer ( error-quot word types type -- quot ) type word? [ type "coercer" word-prop ] [ f ] if [ ] or - type type word types error-quot '[ dup _ instance? [ _ _ _ @ ] unless ] + type type word types error-quot $[ dup _ instance? [ _ _ _ @ ] unless ] type (unboxer) compose compose ; @@ -70,7 +70,7 @@ PRIVATE< types unboxed-types :> unboxed-types [ input-mismatch-error ] word types make-unboxer - unboxed-types quot '[ _ declare @ ] + unboxed-types quot $[ _ declare @ ] compose ; ! typed outputs @@ -93,7 +93,7 @@ DEFER: make-boxer : make-boxer ( types -- quot ) [ [ ] ] - [ [ boxer ] [ swap '[ @ _ dip ] ] map-reduce ] if-empty ; + [ [ boxer ] [ swap $[ @ _ dip ] ] map-reduce ] if-empty ; ! defining typed words @@ -102,7 +102,7 @@ MACRO: (typed) ( word def effect -- quot ) [ nip effect-in-types swap [ [ unboxed-types ] [ make-boxer ] bi ] dip - '[ _ declare @ @ ] + $[ _ declare @ @ ] ] [ effect-out-types @@ -131,7 +131,7 @@ MACRO: typed ( quot word effect -- quot' ) [ effect-in-types dup typed-stack-effect? [ typed-inputs ] [ 2drop ] if ] [ nip effect-out-types dup typed-stack-effect? - [ [ unboxed-types ] [ make-boxer ] bi '[ @ _ declare @ ] ] [ drop ] if + [ [ unboxed-types ] [ make-boxer ] bi $[ @ _ declare @ ] ] [ drop ] if ] 2bi ; : (typed-def) ( word def effect -- quot ) diff --git a/demos/bunny/outlined/outlined.factor b/demos/bunny/outlined/outlined.factor index d38bf8eca9..68aa7e3b58 100644 --- a/demos/bunny/outlined/outlined.factor +++ b/demos/bunny/outlined/outlined.factor @@ -173,7 +173,7 @@ TUPLE: bunny-outlined ] [ drop ] if ; MACRO: (framebuffer-texture>>draw) ( iformat xformat setter -- quot ) - '[ _ _ (framebuffer-texture) [ @ drop ] keep ] ; + $[ _ _ (framebuffer-texture) [ @ drop ] keep ] ; : (make-framebuffer-textures) ( draw dim -- draw color normal depth ) { diff --git a/demos/demos/demos.factor b/demos/demos/demos.factor index 87f977d362..2b9f9cc7df 100644 --- a/demos/demos/demos.factor +++ b/demos/demos/demos.factor @@ -6,7 +6,7 @@ IN: demos : demo-vocabs ( -- seq ) "demos" tagged values concat [ name>> ] map ; : ( vocab-name -- button ) - dup '[ drop [ _ run ] \ run call-listener ] ; + dup $[ drop [ _ run ] \ run call-listener ] ; : ( -- gadget ) 1 >>fill { 2 2 } >>gap demo-vocabs [ add-gadget ] each ; diff --git a/demos/lcd/lcd.factor b/demos/lcd/lcd.factor index 68a30d31e9..51e8ddb36d 100644 --- a/demos/lcd/lcd.factor +++ b/demos/lcd/lcd.factor @@ -14,7 +14,7 @@ IN: lcd } nth 4 nth ; : lcd-row ( row digit -- string ) - '[ _ lcd-digit ] { } map-as concat ; + $[ _ lcd-digit ] { } map-as concat ; : lcd ( digit-str -- string ) 4 iota [ lcd-row ] with map "\n" join ; diff --git a/demos/maze/maze.factor b/demos/maze/maze.factor index 30bf2579f6..8d8c0db286 100644 --- a/demos/maze/maze.factor +++ b/demos/maze/maze.factor @@ -41,7 +41,7 @@ SYMBOL: visited line-width 2 - glLineWidth line-width 2 - glPointSize 1.0 1.0 1.0 1.0 glColor4d - dup '[ _ t ] replicate visited set + dup $[ _ t ] replicate visited set GL_LINE_STRIP glBegin { 0 0 } dup vertex (draw-maze) glEnd ; diff --git a/demos/merger/merger.factor b/demos/merger/merger.factor index a990dd30c4..cfa58e85a3 100644 --- a/demos/merger/merger.factor +++ b/demos/merger/merger.factor @@ -22,7 +22,7 @@ MAIN-WINDOW: merger-window { ] 2each ] keep dup first2 - '[ _ [ value>> ] all? [ parent>> "processing..."