remq -> remove-eq, delq -> remove-eq!

db4
Slava Pestov 2009-10-28 00:23:08 -05:00
parent b7e05a525b
commit 50f5c3d116
10 changed files with 22 additions and 22 deletions

View File

@ -33,7 +33,7 @@ SYMBOL: active-intervals
dup vreg>> active-intervals-for push ; dup vreg>> active-intervals-for push ;
: delete-active ( live-interval -- ) : delete-active ( live-interval -- )
dup vreg>> active-intervals-for delq ; dup vreg>> active-intervals-for remove-eq! drop ;
: assign-free-register ( new registers -- ) : assign-free-register ( new registers -- )
pop >>reg add-active ; pop >>reg add-active ;
@ -48,7 +48,7 @@ SYMBOL: inactive-intervals
dup vreg>> inactive-intervals-for push ; dup vreg>> inactive-intervals-for push ;
: delete-inactive ( live-interval -- ) : delete-inactive ( live-interval -- )
dup vreg>> inactive-intervals-for delq ; dup vreg>> inactive-intervals-for remove-eq! drop ;
! Vector of handled live intervals ! Vector of handled live intervals
SYMBOL: handled-intervals SYMBOL: handled-intervals

View File

@ -10,7 +10,7 @@ tips [ V{ } clone ] initialize
TUPLE: tip < identity-tuple content loc ; TUPLE: tip < identity-tuple content loc ;
M: tip forget* tips get delq ; M: tip forget* tips get remove-eq! drop ;
M: tip where loc>> ; M: tip where loc>> ;

View File

@ -152,7 +152,7 @@ M: world children-on nip children>> ;
M: world remove-gadget M: world remove-gadget
2dup layers>> memq? 2dup layers>> memq?
[ layers>> delq ] [ call-next-method ] if ; [ layers>> remove-eq! drop ] [ call-next-method ] if ;
SYMBOL: flush-layout-cache-hook SYMBOL: flush-layout-cache-hook

View File

@ -69,7 +69,7 @@ GENERIC: definitions-changed ( assoc obj -- )
definition-observers get push ; definition-observers get push ;
: remove-definition-observer ( obj -- ) : remove-definition-observer ( obj -- )
definition-observers get delq ; definition-observers get remove-eq! drop ;
: notify-definition-observers ( assoc -- ) : notify-definition-observers ( assoc -- )
definition-observers get definition-observers get

View File

@ -471,7 +471,7 @@ HELP: remove
{ $description "Outputs a new sequence containing all elements of the input sequence except for given element." } { $description "Outputs a new sequence containing all elements of the input sequence except for given element." }
{ $notes "This word uses equality comparison (" { $link = } ")." } ; { $notes "This word uses equality comparison (" { $link = } ")." } ;
HELP: remq HELP: remove-eq
{ $values { "elt" object } { "seq" sequence } { "newseq" "a new sequence" } } { $values { "elt" object } { "seq" sequence } { "newseq" "a new sequence" } }
{ $description "Outputs a new sequence containing all elements of the input sequence except those equal to the given element." } { $description "Outputs a new sequence containing all elements of the input sequence except those equal to the given element." }
{ $notes "This word uses identity comparison (" { $link eq? } ")." } ; { $notes "This word uses identity comparison (" { $link eq? } ")." } ;
@ -497,8 +497,8 @@ HELP: remove!
{ $notes "This word uses equality comparison (" { $link = } ")." } { $notes "This word uses equality comparison (" { $link = } ")." }
{ $side-effects "seq" } ; { $side-effects "seq" } ;
HELP: delq HELP: remove-eq!
{ $values { "elt" object } { "seq" "a resizable mutable sequence" } } { $values { "elt" object } { "seq" "a resizable mutable sequence" } { "seq" "a resizable mutable sequence" } }
{ $description "Outputs a new sequence containing all elements of the input sequence except the given element." } { $description "Outputs a new sequence containing all elements of the input sequence except the given element." }
{ $notes "This word uses identity comparison (" { $link eq? } ")." } { $notes "This word uses identity comparison (" { $link eq? } ")." }
{ $side-effects "seq" } ; { $side-effects "seq" } ;
@ -861,7 +861,7 @@ HELP: tail?
{ $values { "seq" sequence } { "end" sequence } { "?" "a boolean" } } { $values { "seq" sequence } { "end" sequence } { "?" "a boolean" } }
{ $description "Tests if " { $snippet "seq" } " ends with " { $snippet "end" } ". If " { $snippet "end" } " is longer than " { $snippet "seq" } ", this word outputs " { $link f } "." } ; { $description "Tests if " { $snippet "seq" } " ends with " { $snippet "end" } ". If " { $snippet "end" } " is longer than " { $snippet "seq" } ", this word outputs " { $link f } "." } ;
{ remove remove-nth remq delq remove! remove-nth! } related-words { remove remove-nth remove-eq remove-eq! remove! remove-nth! } related-words
HELP: cut-slice HELP: cut-slice
{ $values { "seq" sequence } { "n" "a non-negative integer" } { "before-slice" sequence } { "after-slice" "a slice" } } { $values { "seq" sequence } { "n" "a non-negative integer" } { "before-slice" sequence } { "after-slice" "a slice" } }
@ -1416,7 +1416,7 @@ ARTICLE: "sequences-add-remove" "Adding and removing sequence elements"
"Adding elements:" "Adding elements:"
{ $subsections prefix suffix insert-nth } { $subsections prefix suffix insert-nth }
"Removing elements:" "Removing elements:"
{ $subsections remove remq remove-nth } ; { $subsections remove remove-eq remove-nth } ;
ARTICLE: "sequences-reshape" "Reshaping sequences" ARTICLE: "sequences-reshape" "Reshaping sequences"
"A " { $emphasis "repetition" } " is a virtual sequence consisting of a single element repeated multiple times:" "A " { $emphasis "repetition" } " is a virtual sequence consisting of a single element repeated multiple times:"
@ -1594,7 +1594,7 @@ ARTICLE: "sequences-destructive" "Destructive operations"
"Deleting elements:" "Deleting elements:"
{ $subsections { $subsections
remove! remove!
delq remove-eq!
remove-nth! remove-nth!
delete-slice delete-slice
delete-all delete-all
@ -1615,7 +1615,7 @@ ARTICLE: "sequences-destructive" "Destructive operations"
{ { $link but-last } { $link pop* } } { { $link but-last } { $link pop* } }
{ { $link unclip-last } { $link pop } } { { $link unclip-last } { $link pop } }
{ { $link remove } { $link remove! } } { { $link remove } { $link remove! } }
{ { $link remq } { $link delq } } { { $link remove-eq } { $link remove-eq! } }
{ { $link remove-nth } { $link remove-nth! } } { { $link remove-nth } { $link remove-nth! } }
{ { $link reverse } { $link reverse-here } } { { $link reverse } { $link reverse-here } }
{ { $link append } { $link push-all } } { { $link append } { $link push-all } }

View File

@ -573,7 +573,7 @@ PRIVATE>
: remove ( elt seq -- newseq ) : remove ( elt seq -- newseq )
[ = not ] with filter ; [ = not ] with filter ;
: remq ( elt seq -- newseq ) : remove-eq ( elt seq -- newseq )
[ eq? not ] with filter ; [ eq? not ] with filter ;
: sift ( seq -- newseq ) : sift ( seq -- newseq )
@ -635,8 +635,8 @@ PRIVATE>
: remove! ( elt seq -- seq ) : remove! ( elt seq -- seq )
[ [ = not ] with filter-here ] keep ; [ [ = not ] with filter-here ] keep ;
: delq ( elt seq -- ) : remove-eq! ( elt seq -- seq )
[ eq? not ] with filter-here ; [ [ eq? not ] with filter-here ] keep ;
: prefix ( seq elt -- newseq ) : prefix ( seq elt -- newseq )
over [ over length 1 + ] dip [ over [ over length 1 + ] dip [

View File

@ -72,7 +72,7 @@ SYMBOL: error-observers
: add-error-observer ( observer -- ) error-observers get push ; : add-error-observer ( observer -- ) error-observers get push ;
: remove-error-observer ( observer -- ) error-observers get delq ; : remove-error-observer ( observer -- ) error-observers get remove-eq! drop ;
: notify-error-observers ( -- ) error-observers get [ errors-changed ] each ; : notify-error-observers ( -- ) error-observers get [ errors-changed ] each ;

View File

@ -129,7 +129,7 @@ TUPLE: no-current-vocab ;
: unuse-vocab ( vocab -- ) : unuse-vocab ( vocab -- )
dup using-vocab? [ dup using-vocab? [
manifest get manifest get
[ [ load-vocab ] dip search-vocabs>> delq ] [ [ load-vocab ] dip search-vocabs>> remove-eq! drop ]
[ [ vocab-name ] dip search-vocab-names>> delete-at ] [ [ vocab-name ] dip search-vocab-names>> delete-at ]
2bi 2bi
] [ drop ] if ; ] [ drop ] if ;

View File

@ -73,7 +73,7 @@ GENERIC: vocabs-changed ( obj -- )
vocab-observers get push ; vocab-observers get push ;
: remove-vocab-observer ( obj -- ) : remove-vocab-observer ( obj -- )
vocab-observers get delq ; vocab-observers get remove-eq! drop ;
: notify-vocab-observers ( -- ) : notify-vocab-observers ( -- )
vocab-observers get [ vocabs-changed ] each ; vocab-observers get [ vocabs-changed ] each ;

View File

@ -53,7 +53,7 @@ syn keyword factorKeyword or tuck 2bi 2tri while wrapper nip 4dip wrapper? bi* c
syn keyword factorKeyword ?at assoc? assoc-clone-like assoc= delete-at* assoc-partition extract-keys new-assoc value? assoc-size map>assoc push-at assoc-like key? assoc-intersect assoc-refine update assoc-union assoc-combine at* assoc-empty? at+ set-at assoc-all? assoc-subset? assoc-hashcode change-at assoc-each assoc-diff zip values value-at rename-at inc-at enum? at cache assoc>map <enum> assoc assoc-map enum value-at* assoc-map-as >alist assoc-filter-as substitute-here clear-assoc assoc-stack maybe-set-at substitute assoc-filter 2cache delete-at assoc-find keys assoc-any? unzip syn keyword factorKeyword ?at assoc? assoc-clone-like assoc= delete-at* assoc-partition extract-keys new-assoc value? assoc-size map>assoc push-at assoc-like key? assoc-intersect assoc-refine update assoc-union assoc-combine at* assoc-empty? at+ set-at assoc-all? assoc-subset? assoc-hashcode change-at assoc-each assoc-diff zip values value-at rename-at inc-at enum? at cache assoc>map <enum> assoc assoc-map enum value-at* assoc-map-as >alist assoc-filter-as substitute-here clear-assoc assoc-stack maybe-set-at substitute assoc-filter 2cache delete-at assoc-find keys assoc-any? unzip
syn keyword factorKeyword case execute-effect no-cond no-case? 3cleave>quot 2cleave cond>quot wrong-values? no-cond? cleave>quot no-case case>quot 3cleave wrong-values to-fixed-point alist>quot case-find cond cleave call-effect 2cleave>quot recursive-hashcode linear-case-quot spread spread>quot syn keyword factorKeyword case execute-effect no-cond no-case? 3cleave>quot 2cleave cond>quot wrong-values? no-cond? cleave>quot no-case case>quot 3cleave wrong-values to-fixed-point alist>quot case-find cond cleave call-effect 2cleave>quot recursive-hashcode linear-case-quot spread spread>quot
syn keyword factorKeyword byte-array>bignum sgn >bignum next-float number= each-integer next-power-of-2 ?1+ fp-special? imaginary-part mod recip float>bits rational >float number? 2^ bignum? integer fixnum? neg fixnum sq bignum fp-snan? fp-infinity? denominator (all-integers?) times find-last-integer (each-integer) bit? * + fp-bitwise= - fp-qnan? / power-of-2? >= bitand find-integer complex <fp-nan> < log2 > integer? real number bits>double double>bits bitor 2/ zero? rem fp-nan-payload all-integers? (find-integer) real-part prev-float align bits>float float? shift float fp-nan? abs bitxor ratio? even? <= /mod odd? >integer ratio rational? bitnot real? >fixnum complex? /i numerator /f syn keyword factorKeyword byte-array>bignum sgn >bignum next-float number= each-integer next-power-of-2 ?1+ fp-special? imaginary-part mod recip float>bits rational >float number? 2^ bignum? integer fixnum? neg fixnum sq bignum fp-snan? fp-infinity? denominator (all-integers?) times find-last-integer (each-integer) bit? * + fp-bitwise= - fp-qnan? / power-of-2? >= bitand find-integer complex <fp-nan> < log2 > integer? real number bits>double double>bits bitor 2/ zero? rem fp-nan-payload all-integers? (find-integer) real-part prev-float align bits>float float? shift float fp-nan? abs bitxor ratio? even? <= /mod odd? >integer ratio rational? bitnot real? >fixnum complex? /i numerator /f
syn keyword factorKeyword append assert-sequence= find-last-from trim-head-slice clone-like 3sequence assert-sequence? map-as filter-here last-index-from reversed index-from cut* pad-tail (indices) concat-as remq but-last snip trim-tail nths nth 2pusher sequence slice? <slice> partition remove-nth tail-slice empty? tail* if-empty find-from virtual-sequence? member? set-length delq drop-prefix unclip iota unclip-last-slice bounds-error? sequence-hashcode-step map start midpoint@ rest-slice prepend fourth sift delete sigma new-sequence follow like remove-nth! first4 1sequence reverse slice unless-empty padding virtual@ repetition? set-last index 4sequence max-length set-second immutable-sequence first2 first3 replicate-as reduce-index unclip-slice supremum insert-nth trim-tail-slice tail 3append short count suffix concat flip filter sum immutable? 2sequence map-integers delete-all start* indices snip-slice check-slice sequence? head map-find reduce append-as reverse-here sequence= halves collapse-slice interleave 2map binary-reduce virtual-seq slice-error? product bounds-check? bounds-check harvest immutable find produce remove pad-head last replicate set-fourth shorten reversed? map-find-last 3map-as 2unclip-slice shorter? 3map find-last head-slice pop* 2map-as tail-slice* but-last-slice 2map-reduce iota? accumulate each pusher cut-slice new-resizable each-index head-slice* 2reverse-each sequence-hashcode memq? pop set-nth ?nth <flat-slice> second map! join when-empty accumulator immutable-sequence? <reversed> all? 3append-as virtual-sequence subseq? push-either new-like length last-index push-if 2all? lengthen assert-sequence copy map-reduce move third first 3each tail? set-first prefix bounds-error any? <repetition> trim-slice exchange surround 2reduce cut change-nth min-length set-third produce-as push-all head? delete-slice rest sum-lengths 2each head* infimum glue slice-error subseq replace-slice push repetition map-index trim-head unclip-last mismatch trim syn keyword factorKeyword append assert-sequence= find-last-from trim-head-slice clone-like 3sequence assert-sequence? map-as filter-here last-index-from reversed index-from cut* pad-tail (indices) concat-as remove-eq but-last snip trim-tail nths nth 2pusher sequence slice? <slice> partition remove-nth tail-slice empty? tail* if-empty find-from virtual-sequence? member? set-length remove-eq! drop-prefix unclip iota unclip-last-slice bounds-error? sequence-hashcode-step map start midpoint@ rest-slice prepend fourth sift delete sigma new-sequence follow like remove-nth! first4 1sequence reverse slice unless-empty padding virtual@ repetition? set-last index 4sequence max-length set-second immutable-sequence first2 first3 replicate-as reduce-index unclip-slice supremum insert-nth trim-tail-slice tail 3append short count suffix concat flip filter sum immutable? 2sequence map-integers delete-all start* indices snip-slice check-slice sequence? head map-find reduce append-as reverse-here sequence= halves collapse-slice interleave 2map binary-reduce virtual-seq slice-error? product bounds-check? bounds-check harvest immutable find produce remove pad-head last replicate set-fourth shorten reversed? map-find-last 3map-as 2unclip-slice shorter? 3map find-last head-slice pop* 2map-as tail-slice* but-last-slice 2map-reduce iota? accumulate each pusher cut-slice new-resizable each-index head-slice* 2reverse-each sequence-hashcode memq? pop set-nth ?nth <flat-slice> second map! join when-empty accumulator immutable-sequence? <reversed> all? 3append-as virtual-sequence subseq? push-either new-like length last-index push-if 2all? lengthen assert-sequence copy map-reduce move third first 3each tail? set-first prefix bounds-error any? <repetition> trim-slice exchange surround 2reduce cut change-nth min-length set-third produce-as push-all head? delete-slice rest sum-lengths 2each head* infimum glue slice-error subseq replace-slice push repetition map-index trim-head unclip-last mismatch trim
syn keyword factorKeyword global +@ change set-namestack change-global init-namespaces on off set-global namespace set with-scope bind with-variable inc dec counter initialize namestack get get-global make-assoc syn keyword factorKeyword global +@ change set-namestack change-global init-namespaces on off set-global namespace set with-scope bind with-variable inc dec counter initialize namestack get get-global make-assoc
syn keyword factorKeyword <array> 2array 3array pair >array 1array 4array pair? array resize-array array? syn keyword factorKeyword <array> 2array 3array pair >array 1array 4array pair? array resize-array array?
syn keyword factorKeyword +character+ bad-seek-type? readln stream-seek read print with-output-stream contents write1 stream-write1 stream-copy stream-element-type with-input-stream stream-print stream-read stream-contents bl seek-output bad-seek-type nl stream-nl write flush stream-lines +byte+ stream-flush read1 seek-absolute? stream-read1 lines stream-readln stream-read-until each-line seek-end with-output-stream* seek-absolute with-streams seek-input seek-relative? input-stream stream-write read-partial seek-end? seek-relative error-stream read-until with-input-stream* with-streams* each-block output-stream stream-read-partial syn keyword factorKeyword +character+ bad-seek-type? readln stream-seek read print with-output-stream contents write1 stream-write1 stream-copy stream-element-type with-input-stream stream-print stream-read stream-contents bl seek-output bad-seek-type nl stream-nl write flush stream-lines +byte+ stream-flush read1 seek-absolute? stream-read1 lines stream-readln stream-read-until each-line seek-end with-output-stream* seek-absolute with-streams seek-input seek-relative? input-stream stream-write read-partial seek-end? seek-relative error-stream read-until with-input-stream* with-streams* each-block output-stream stream-read-partial