use reject instead of [ ... not ] filter.
parent
6071ea98f7
commit
b366a06c41
|
@ -20,7 +20,7 @@ CONSTANT: mach-map {
|
||||||
[
|
[
|
||||||
" " split1 [ "()" in? ] trim "," split
|
" " split1 [ "()" in? ] trim "," split
|
||||||
[ [ blank? ] trim ] map
|
[ [ blank? ] trim ] map
|
||||||
[ "OS ABI:" head? not ] filter
|
[ "OS ABI:" head? ] reject
|
||||||
] dip 3array
|
] dip 3array
|
||||||
] map ;
|
] map ;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ gc
|
||||||
|
|
||||||
: compile-unoptimized ( words -- )
|
: compile-unoptimized ( words -- )
|
||||||
[ [ subwords ] map ] keep suffix concat
|
[ [ subwords ] map ] keep suffix concat
|
||||||
[ optimized? not ] filter compile ;
|
[ optimized? ] reject compile ;
|
||||||
|
|
||||||
"debug-compiler" get [
|
"debug-compiler" get [
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ IN: bootstrap.help
|
||||||
|
|
||||||
[ dup lookup-vocab [ drop ] [ no-vocab ] if ] require-hook [
|
[ dup lookup-vocab [ drop ] [ no-vocab ] if ] require-hook [
|
||||||
dictionary get values
|
dictionary get values
|
||||||
[ docs-loaded?>> not ] filter
|
[ docs-loaded?>> ] reject
|
||||||
[ load-docs ] each
|
[ load-docs ] each
|
||||||
] with-variable ;
|
] with-variable ;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ ERROR: odd-length-hex-string string ;
|
||||||
|
|
||||||
SYNTAX: HEX{
|
SYNTAX: HEX{
|
||||||
"}" parse-tokens concat
|
"}" parse-tokens concat
|
||||||
[ blank? not ] filter
|
[ blank? ] reject
|
||||||
dup length even? [ odd-length-hex-string ] unless
|
dup length even? [ odd-length-hex-string ] unless
|
||||||
2 <groups> [ hex> ] B{ } map-as
|
2 <groups> [ hex> ] B{ } map-as
|
||||||
suffix! ;
|
suffix! ;
|
||||||
|
|
|
@ -245,7 +245,7 @@ M: struct-bit-slot-spec compute-slot-offset
|
||||||
1 [ 0 >>offset type>> heap-size max ] reduce ;
|
1 [ 0 >>offset type>> heap-size max ] reduce ;
|
||||||
|
|
||||||
: struct-alignment ( slots -- align )
|
: struct-alignment ( slots -- align )
|
||||||
[ struct-bit-slot-spec? not ] filter
|
[ struct-bit-slot-spec? ] reject
|
||||||
1 [ dup offset>> c-type-align-at max ] reduce ;
|
1 [ dup offset>> c-type-align-at max ] reduce ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
|
@ -12,7 +12,7 @@ IN: colors.constants
|
||||||
[ blank? ] trim-head H{ { CHAR: \s CHAR: - } } substitute swap ;
|
[ blank? ] trim-head H{ { CHAR: \s CHAR: - } } substitute swap ;
|
||||||
|
|
||||||
: parse-colors ( lines -- assoc )
|
: parse-colors ( lines -- assoc )
|
||||||
[ "!" head? not ] filter
|
[ "!" head? ] reject
|
||||||
[ 11 cut [ " \t" split harvest ] dip suffix ] map
|
[ 11 cut [ " \t" split harvest ] dip suffix ] map
|
||||||
[ parse-color ] H{ } map>assoc ;
|
[ parse-color ] H{ } map>assoc ;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ IN: compiler.cfg.hats
|
||||||
|
|
||||||
: hat-effect ( insn -- effect )
|
: hat-effect ( insn -- effect )
|
||||||
"insn-slots" word-prop
|
"insn-slots" word-prop
|
||||||
[ type>> { def temp } member-eq? not ] filter [ name>> ] map
|
[ type>> { def temp } member-eq? ] reject [ name>> ] map
|
||||||
{ "vreg" } <effect> ;
|
{ "vreg" } <effect> ;
|
||||||
|
|
||||||
: define-hat ( insn -- )
|
: define-hat ( insn -- )
|
||||||
|
|
|
@ -147,5 +147,5 @@ M: insn assign-registers-in-insn drop ;
|
||||||
|
|
||||||
: assign-registers ( cfg live-intervals -- )
|
: assign-registers ( cfg live-intervals -- )
|
||||||
init-assignment
|
init-assignment
|
||||||
linearization-order [ kill-block?>> not ] filter
|
linearization-order [ kill-block?>> ] reject
|
||||||
[ assign-registers-in-block ] each ;
|
[ assign-registers-in-block ] each ;
|
||||||
|
|
|
@ -10,7 +10,7 @@ IN: compiler.cfg.linear-scan
|
||||||
|
|
||||||
: admissible-registers ( cfg -- regs )
|
: admissible-registers ( cfg -- regs )
|
||||||
machine-registers swap frame-pointer?>> [
|
machine-registers swap frame-pointer?>> [
|
||||||
[ [ frame-reg = not ] filter ] assoc-map
|
[ [ frame-reg = ] reject ] assoc-map
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
: allocate-and-assign-registers ( cfg -- )
|
: allocate-and-assign-registers ( cfg -- )
|
||||||
|
|
|
@ -214,7 +214,7 @@ ERROR: bad-live-interval live-interval ;
|
||||||
|
|
||||||
: compute-live-intervals ( cfg -- live-intervals sync-points )
|
: compute-live-intervals ( cfg -- live-intervals sync-points )
|
||||||
init-live-intervals
|
init-live-intervals
|
||||||
linearization-order <reversed> [ kill-block?>> not ] filter
|
linearization-order <reversed> [ kill-block?>> ] reject
|
||||||
[ compute-live-intervals-step ] each
|
[ compute-live-intervals-step ] each
|
||||||
live-intervals get finish-live-intervals
|
live-intervals get finish-live-intervals
|
||||||
sync-points get ;
|
sync-points get ;
|
||||||
|
|
|
@ -45,7 +45,7 @@ SYMBOLS: loop-heads visited ;
|
||||||
dup visited get ?adjoin [ dup , sorted-successors ] [ drop { } ] if
|
dup visited get ?adjoin [ dup , sorted-successors ] [ drop { } ] if
|
||||||
[ predecessors-ready? ] filter
|
[ predecessors-ready? ] filter
|
||||||
[ dup loop-entry? [ find-alternate-loop-head ] when ] map
|
[ dup loop-entry? [ find-alternate-loop-head ] when ] map
|
||||||
[ visited? not ] filter ;
|
[ visited? ] reject ;
|
||||||
|
|
||||||
: (linearization-order) ( cfg -- bbs )
|
: (linearization-order) ( cfg -- bbs )
|
||||||
HS{ } clone visited set
|
HS{ } clone visited set
|
||||||
|
|
|
@ -14,7 +14,7 @@ SYMBOLS: locs preds to-do ready ;
|
||||||
to-do get push-all-back ;
|
to-do get push-all-back ;
|
||||||
|
|
||||||
: init-ready ( bs -- )
|
: init-ready ( bs -- )
|
||||||
locs get '[ _ key? not ] filter ready get push-all-front ;
|
locs get '[ _ key? ] reject ready get push-all-front ;
|
||||||
|
|
||||||
: init ( mapping -- )
|
: init ( mapping -- )
|
||||||
<dlist> to-do set
|
<dlist> to-do set
|
||||||
|
|
|
@ -65,19 +65,19 @@ M: ##callback-outputs rename-insn-uses
|
||||||
drop ;
|
drop ;
|
||||||
|
|
||||||
! Generate methods for everything else
|
! Generate methods for everything else
|
||||||
insn-classes get special-vreg-insns diff [ insn-def-slots empty? not ] filter [
|
insn-classes get special-vreg-insns diff [ insn-def-slots empty? ] reject [
|
||||||
[ \ rename-insn-defs create-method-in ]
|
[ \ rename-insn-defs create-method-in ]
|
||||||
[ insn-def-slots [ name>> ] map DEF-QUOT slot-change-quot ] bi
|
[ insn-def-slots [ name>> ] map DEF-QUOT slot-change-quot ] bi
|
||||||
define
|
define
|
||||||
] each
|
] each
|
||||||
|
|
||||||
insn-classes get special-vreg-insns diff [ insn-use-slots empty? not ] filter [
|
insn-classes get special-vreg-insns diff [ insn-use-slots empty? ] reject [
|
||||||
[ \ rename-insn-uses create-method-in ]
|
[ \ rename-insn-uses create-method-in ]
|
||||||
[ insn-use-slots [ name>> ] map USE-QUOT slot-change-quot ] bi
|
[ insn-use-slots [ name>> ] map USE-QUOT slot-change-quot ] bi
|
||||||
define
|
define
|
||||||
] each
|
] each
|
||||||
|
|
||||||
insn-classes get [ insn-temp-slots empty? not ] filter [
|
insn-classes get [ insn-temp-slots empty? ] reject [
|
||||||
[ \ rename-insn-temps create-method-in ]
|
[ \ rename-insn-temps create-method-in ]
|
||||||
[ insn-temp-slots [ name>> ] map TEMP-QUOT slot-change-quot ] bi
|
[ insn-temp-slots [ name>> ] map TEMP-QUOT slot-change-quot ] bi
|
||||||
define
|
define
|
||||||
|
|
|
@ -115,7 +115,7 @@ M: ##copy cleanup-insn
|
||||||
dup useful-copy? [ , ] [ drop ] if ;
|
dup useful-copy? [ , ] [ drop ] if ;
|
||||||
|
|
||||||
M: ##parallel-copy cleanup-insn
|
M: ##parallel-copy cleanup-insn
|
||||||
values>> [ leaders ] assoc-map [ first2 = not ] filter
|
values>> [ leaders ] assoc-map [ first2 = ] reject
|
||||||
parallel-copy-rep % ;
|
parallel-copy-rep % ;
|
||||||
|
|
||||||
M: ##tagged>integer cleanup-insn
|
M: ##tagged>integer cleanup-insn
|
||||||
|
|
|
@ -24,7 +24,7 @@ IN: compiler.cfg.stacks.local
|
||||||
|
|
||||||
: height-state>insns ( state -- insns )
|
: height-state>insns ( state -- insns )
|
||||||
[ second ] map { ds-loc rs-loc } [ new swap >>n ] 2map
|
[ second ] map { ds-loc rs-loc } [ new swap >>n ] 2map
|
||||||
[ n>> 0 = not ] filter [ ##inc new swap >>loc ] map ;
|
[ n>> 0 = ] reject [ ##inc new swap >>loc ] map ;
|
||||||
|
|
||||||
: translate-local-loc ( loc state -- loc' )
|
: translate-local-loc ( loc state -- loc' )
|
||||||
[ clone ] dip over >loc< 0 1 ? rot nth first - >>n ;
|
[ clone ] dip over >loc< 0 1 ? rot nth first - >>n ;
|
||||||
|
|
|
@ -5,5 +5,5 @@ IN: compiler.crossref.tests
|
||||||
! in the middle of recompiling something
|
! in the middle of recompiling something
|
||||||
[ { } ] [
|
[ { } ] [
|
||||||
all-words dup [ subwords ] map concat append
|
all-words dup [ subwords ] map concat append
|
||||||
H{ } clone '[ _ dependencies-satisfied? not ] filter
|
H{ } clone '[ _ dependencies-satisfied? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -12,7 +12,7 @@ IN: compiler.tree.cleanup
|
||||||
GENERIC: delete-node ( node -- )
|
GENERIC: delete-node ( node -- )
|
||||||
|
|
||||||
M: #call-recursive delete-node
|
M: #call-recursive delete-node
|
||||||
dup label>> calls>> [ node>> eq? not ] with filter! drop ;
|
dup label>> calls>> [ node>> eq? ] with reject! drop ;
|
||||||
|
|
||||||
M: #return-recursive delete-node
|
M: #return-recursive delete-node
|
||||||
label>> f >>return drop ;
|
label>> f >>return drop ;
|
||||||
|
|
|
@ -301,7 +301,7 @@ CONSTANT: lookup-table-at-max 256
|
||||||
\ at* [ at-quot ] 1 define-partial-eval
|
\ at* [ at-quot ] 1 define-partial-eval
|
||||||
|
|
||||||
: diff-quot ( seq -- quot: ( seq' -- seq'' ) )
|
: diff-quot ( seq -- quot: ( seq' -- seq'' ) )
|
||||||
[ tester ] keep '[ members [ @ not ] filter _ set-like ] ;
|
[ tester ] keep '[ members [ @ ] reject _ set-like ] ;
|
||||||
|
|
||||||
M\ set diff [ diff-quot ] 1 define-partial-eval
|
M\ set diff [ diff-quot ] 1 define-partial-eval
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ SYMBOLS: not-loops recursive-nesting ;
|
||||||
: not-a-loop? ( label -- ? ) not-loops get in? ;
|
: not-a-loop? ( label -- ? ) not-loops get in? ;
|
||||||
|
|
||||||
: non-tail-calls ( call-graph-node -- seq )
|
: non-tail-calls ( call-graph-node -- seq )
|
||||||
calls>> [ tail?>> not ] filter ;
|
calls>> [ tail?>> ] reject ;
|
||||||
|
|
||||||
: visit-back-edges ( call-graph -- )
|
: visit-back-edges ( call-graph -- )
|
||||||
[
|
[
|
||||||
|
|
|
@ -33,7 +33,7 @@ SYMBOL: IGNORE
|
||||||
|
|
||||||
: filter-ignores ( tuple specs -- specs' )
|
: filter-ignores ( tuple specs -- specs' )
|
||||||
[ <mirror> [ nip IGNORE = ] assoc-filter keys ] dip
|
[ <mirror> [ nip IGNORE = ] assoc-filter keys ] dip
|
||||||
[ slot-name>> swap member? not ] with filter ;
|
[ slot-name>> swap member? ] with reject ;
|
||||||
|
|
||||||
ERROR: not-persistent class ;
|
ERROR: not-persistent class ;
|
||||||
|
|
||||||
|
@ -99,13 +99,13 @@ FACTOR-BLOB NULL URL ;
|
||||||
dup number? [ number>string ] when ;
|
dup number? [ number>string ] when ;
|
||||||
|
|
||||||
: remove-db-assigned-id ( specs -- obj )
|
: remove-db-assigned-id ( specs -- obj )
|
||||||
[ +db-assigned-id+? not ] filter ;
|
[ +db-assigned-id+? ] reject ;
|
||||||
|
|
||||||
: remove-relations ( specs -- newcolumns )
|
: remove-relations ( specs -- newcolumns )
|
||||||
[ relation? not ] filter ;
|
[ relation? ] reject ;
|
||||||
|
|
||||||
: remove-id ( specs -- obj )
|
: remove-id ( specs -- obj )
|
||||||
[ primary-key>> not ] filter ;
|
[ primary-key>> ] reject ;
|
||||||
|
|
||||||
! SQLite Types: http://www.sqlite.org/datatype3.html
|
! SQLite Types: http://www.sqlite.org/datatype3.html
|
||||||
! NULL INTEGER REAL TEXT BLOB
|
! NULL INTEGER REAL TEXT BLOB
|
||||||
|
|
|
@ -159,7 +159,7 @@ SYMBOLS: +dinput+ +keyboard-device+ +keyboard-state+
|
||||||
|
|
||||||
: find-and-remove-detached-devices ( -- )
|
: find-and-remove-detached-devices ( -- )
|
||||||
+controller-devices+ get-global keys
|
+controller-devices+ get-global keys
|
||||||
[ device-attached? not ] filter
|
[ device-attached? ] reject
|
||||||
[ remove-controller ] each ;
|
[ remove-controller ] each ;
|
||||||
|
|
||||||
: ?device-interface ( dbt-broadcast-hdr -- ? )
|
: ?device-interface ( dbt-broadcast-hdr -- ? )
|
||||||
|
|
|
@ -323,7 +323,7 @@ M: array-type field-type>c-type type>c-type ;
|
||||||
: def-classes ( classes -- ) [ def-class ] each ;
|
: def-classes ( classes -- ) [ def-class ] each ;
|
||||||
|
|
||||||
: def-boxeds ( boxeds -- )
|
: def-boxeds ( boxeds -- )
|
||||||
[ find-existing-boxed-type not ] filter
|
[ find-existing-boxed-type ] reject
|
||||||
[ def-boxed-type ] each ;
|
[ def-boxed-type ] each ;
|
||||||
|
|
||||||
: def-records ( records -- )
|
: def-records ( records -- )
|
||||||
|
|
|
@ -33,7 +33,7 @@ M: predicate word-help* drop \ $predicate ;
|
||||||
|
|
||||||
: orphan-articles ( -- seq )
|
: orphan-articles ( -- seq )
|
||||||
articles get keys
|
articles get keys
|
||||||
[ article-parent not ] filter ;
|
[ article-parent ] reject ;
|
||||||
|
|
||||||
: xref-help ( -- )
|
: xref-help ( -- )
|
||||||
all-articles [ xref-article ] each ;
|
all-articles [ xref-article ] each ;
|
||||||
|
|
|
@ -99,7 +99,7 @@ M: pathname url-of
|
||||||
|
|
||||||
: all-vocabs-really ( -- seq )
|
: all-vocabs-really ( -- seq )
|
||||||
all-vocabs-recursive no-roots remove-redundant-prefixes
|
all-vocabs-recursive no-roots remove-redundant-prefixes
|
||||||
[ vocab-name "scratchpad" = not ] filter ;
|
[ vocab-name "scratchpad" = ] reject ;
|
||||||
|
|
||||||
: all-topics ( -- topics )
|
: all-topics ( -- topics )
|
||||||
[
|
[
|
||||||
|
|
|
@ -157,7 +157,7 @@ SYMBOL: vocab-articles
|
||||||
dup struct-class? [ struct-slots ] [ all-slots ] if
|
dup struct-class? [ struct-slots ] [ all-slots ] if
|
||||||
[ name>> ] map
|
[ name>> ] map
|
||||||
] [ extract-slots ] bi*
|
] [ extract-slots ] bi*
|
||||||
[ swap member? not ] with filter [
|
[ swap member? ] with reject [
|
||||||
", " join "Described $slot does not exist: " prepend
|
", " join "Described $slot does not exist: " prepend
|
||||||
simple-lint-error
|
simple-lint-error
|
||||||
] unless-empty
|
] unless-empty
|
||||||
|
|
|
@ -93,10 +93,10 @@ PRIVATE>
|
||||||
: :lint-failures ( -- ) lint-failures get values errors. ;
|
: :lint-failures ( -- ) lint-failures get values errors. ;
|
||||||
|
|
||||||
: unlinked-words ( vocab -- seq )
|
: unlinked-words ( vocab -- seq )
|
||||||
words all-word-help [ article-parent not ] filter ;
|
words all-word-help [ article-parent ] reject ;
|
||||||
|
|
||||||
: linked-undocumented-words ( -- seq )
|
: linked-undocumented-words ( -- seq )
|
||||||
all-words
|
all-words
|
||||||
[ word-help not ] filter
|
[ word-help ] reject
|
||||||
[ article-parent ] filter
|
[ article-parent ] filter
|
||||||
[ predicate? not ] filter ;
|
[ predicate? ] reject ;
|
||||||
|
|
|
@ -31,7 +31,7 @@ IN: help.search
|
||||||
|
|
||||||
MEMO: article-words ( name -- words )
|
MEMO: article-words ( name -- words )
|
||||||
article-content [ element-value ] map " " join search-words
|
article-content [ element-value ] map " " join search-words
|
||||||
[ [ digit? ] all? not ] filter
|
[ [ digit? ] all? ] reject
|
||||||
[ [ { [ letter? ] [ digit? ] } 1|| not ] trim ] map! harvest ;
|
[ [ { [ letter? ] [ digit? ] } 1|| not ] trim ] map! harvest ;
|
||||||
|
|
||||||
: (search-articles) ( string -- seq' )
|
: (search-articles) ( string -- seq' )
|
||||||
|
|
|
@ -200,7 +200,7 @@ C: <vocab-author> vocab-author
|
||||||
natural-sort
|
natural-sort
|
||||||
[ [ class? ] filter describe-classes ]
|
[ [ class? ] filter describe-classes ]
|
||||||
[
|
[
|
||||||
[ [ class? ] [ symbol? ] bi and not ] filter
|
[ [ class? ] [ symbol? ] bi and ] reject
|
||||||
[ parsing-word? ] partition
|
[ parsing-word? ] partition
|
||||||
[ generic? ] partition
|
[ generic? ] partition
|
||||||
[ macro? ] partition
|
[ macro? ] partition
|
||||||
|
|
|
@ -9,7 +9,7 @@ IN: html.templates.chloe.tests
|
||||||
[ ] [ reset-cache ] unit-test
|
[ ] [ reset-cache ] unit-test
|
||||||
|
|
||||||
: run-template ( quot -- string )
|
: run-template ( quot -- string )
|
||||||
with-string-writer [ "\r\n\t" member? not ] filter
|
with-string-writer [ "\r\n\t" member? ] reject
|
||||||
"?>" split1 nip ; inline
|
"?>" split1 nip ; inline
|
||||||
|
|
||||||
: test-template ( name -- template )
|
: test-template ( name -- template )
|
||||||
|
@ -97,7 +97,7 @@ M: link-test link-href drop "http://www.apple.com/foo&bar" ;
|
||||||
[ "<ul><li>1</li><li>2</li><li>3</li></ul>" ] [
|
[ "<ul><li>1</li><li>2</li><li>3</li></ul>" ] [
|
||||||
[
|
[
|
||||||
"test7" test-template call-template
|
"test7" test-template call-template
|
||||||
] run-template [ blank? not ] filter
|
] run-template [ blank? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
TUPLE: person first-name last-name ;
|
TUPLE: person first-name last-name ;
|
||||||
|
@ -112,7 +112,7 @@ TUPLE: person first-name last-name ;
|
||||||
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" ] [
|
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" ] [
|
||||||
[
|
[
|
||||||
"test8" test-template call-template
|
"test8" test-template call-template
|
||||||
] run-template [ blank? not ] filter
|
] run-template [ blank? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ ] [
|
[ ] [
|
||||||
|
@ -125,7 +125,7 @@ TUPLE: person first-name last-name ;
|
||||||
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" ] [
|
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" ] [
|
||||||
[
|
[
|
||||||
"test8" test-template call-template
|
"test8" test-template call-template
|
||||||
] run-template [ blank? not ] filter
|
] run-template [ blank? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ ] [ 1 "id" set-value ] unit-test
|
[ ] [ 1 "id" set-value ] unit-test
|
||||||
|
@ -153,7 +153,7 @@ TUPLE: person first-name last-name ;
|
||||||
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr></table>" ] [
|
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr></table>" ] [
|
||||||
[
|
[
|
||||||
"test11" test-template call-template
|
"test11" test-template call-template
|
||||||
] run-template [ blank? not ] filter
|
] run-template [ blank? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ ] [
|
[ ] [
|
||||||
|
|
|
@ -53,7 +53,7 @@ PRIVATE>
|
||||||
M: tuple error. describe ;
|
M: tuple error. describe ;
|
||||||
|
|
||||||
: vars-in-scope ( seq -- alist )
|
: vars-in-scope ( seq -- alist )
|
||||||
[ [ global eq? not ] filter [ keys ] gather ] keep
|
[ [ global eq? ] reject [ keys ] gather ] keep
|
||||||
'[ dup _ assoc-stack ] H{ } map>assoc ;
|
'[ dup _ assoc-stack ] H{ } map>assoc ;
|
||||||
|
|
||||||
: .vars ( -- )
|
: .vars ( -- )
|
||||||
|
|
|
@ -38,7 +38,7 @@ HOOK: (directory-entries) os ( path -- seq )
|
||||||
: directory-entries ( path -- seq )
|
: directory-entries ( path -- seq )
|
||||||
normalize-path
|
normalize-path
|
||||||
(directory-entries)
|
(directory-entries)
|
||||||
[ name>> { "." ".." } member? not ] filter ;
|
[ name>> { "." ".." } member? ] reject ;
|
||||||
|
|
||||||
: directory-files ( path -- seq )
|
: directory-files ( path -- seq )
|
||||||
directory-entries [ name>> ] map! ;
|
directory-entries [ name>> ] map! ;
|
||||||
|
|
|
@ -243,7 +243,7 @@ PRIVATE>
|
||||||
server-addrs [ secure? ] filter random ;
|
server-addrs [ secure? ] filter random ;
|
||||||
|
|
||||||
: insecure-addr ( -- addrspec )
|
: insecure-addr ( -- addrspec )
|
||||||
server-addrs [ secure? not ] filter random ;
|
server-addrs [ secure? ] reject random ;
|
||||||
|
|
||||||
: server. ( threaded-server -- )
|
: server. ( threaded-server -- )
|
||||||
[ [ "=== " write name>> ] [ ] bi write-object nl ]
|
[ [ "=== " write name>> ] [ ] bi write-object nl ]
|
||||||
|
|
|
@ -6,5 +6,5 @@ IN: io.sockets.icmp.tests
|
||||||
|
|
||||||
[ { } ] [
|
[ { } ] [
|
||||||
"localhost" <icmp> resolve-host
|
"localhost" <icmp> resolve-host
|
||||||
[ [ icmp4? ] [ icmp6? ] bi or not ] filter
|
[ [ icmp4? ] [ icmp6? ] bi or ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -70,7 +70,7 @@ SYMBOL: matrix
|
||||||
[ 0 0 (echelon) ] with-matrix ;
|
[ 0 0 (echelon) ] with-matrix ;
|
||||||
|
|
||||||
: nonzero-rows ( matrix -- matrix' )
|
: nonzero-rows ( matrix -- matrix' )
|
||||||
[ [ zero? ] all? not ] filter ;
|
[ [ zero? ] all? ] reject ;
|
||||||
|
|
||||||
: null/rank ( matrix -- null rank )
|
: null/rank ( matrix -- null rank )
|
||||||
echelon dup length swap nonzero-rows length [ - ] keep ;
|
echelon dup length swap nonzero-rows length [ - ] keep ;
|
||||||
|
|
|
@ -183,7 +183,7 @@ TUPLE: simd-test-failure
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ { } ] [
|
[ { } ] [
|
||||||
simd-classes [ '[ _ new ] compile-call [ zero? ] all? not ] filter
|
simd-classes [ '[ _ new ] compile-call [ zero? ] all? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
"== Checking -with constructors" print
|
"== Checking -with constructors" print
|
||||||
|
|
|
@ -7,7 +7,7 @@ IN: mime.types
|
||||||
|
|
||||||
MEMO: mime-db ( -- seq )
|
MEMO: mime-db ( -- seq )
|
||||||
"vocab:mime/types/mime.types" ascii file-lines
|
"vocab:mime/types/mime.types" ascii file-lines
|
||||||
[ "#" head? not ] filter [ " \t" split harvest ] map harvest ;
|
[ "#" head? ] reject [ " \t" split harvest ] map harvest ;
|
||||||
|
|
||||||
: nonstandard-mime-types ( -- assoc )
|
: nonstandard-mime-types ( -- assoc )
|
||||||
H{
|
H{
|
||||||
|
|
|
@ -109,7 +109,7 @@ PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
|
||||||
dup gl-program-shaders-length 2 *
|
dup gl-program-shaders-length 2 *
|
||||||
0 int <ref>
|
0 int <ref>
|
||||||
over uint <c-array>
|
over uint <c-array>
|
||||||
[ glGetAttachedShaders ] keep [ zero? not ] filter ;
|
[ glGetAttachedShaders ] keep [ zero? ] reject ;
|
||||||
|
|
||||||
: delete-gl-program-only ( program -- )
|
: delete-gl-program-only ( program -- )
|
||||||
glDeleteProgram ; inline
|
glDeleteProgram ; inline
|
||||||
|
|
|
@ -97,7 +97,7 @@ C: <ebnf> ebnf
|
||||||
|
|
||||||
: filter-hidden ( seq -- seq )
|
: filter-hidden ( seq -- seq )
|
||||||
#! Remove elements that produce no AST from sequence
|
#! Remove elements that produce no AST from sequence
|
||||||
[ ebnf-ensure-not? not ] filter [ ebnf-ensure? not ] filter ;
|
[ ebnf-ensure-not? ] reject [ ebnf-ensure? not ] filter ;
|
||||||
|
|
||||||
: syntax ( string -- parser )
|
: syntax ( string -- parser )
|
||||||
#! Parses the string, ignoring white space, and
|
#! Parses the string, ignoring white space, and
|
||||||
|
|
|
@ -60,5 +60,5 @@ io.files io.encodings.utf8 ;
|
||||||
"vocab:porter-stemmer/test/voc.txt" utf8 file-lines
|
"vocab:porter-stemmer/test/voc.txt" utf8 file-lines
|
||||||
[ stem ] map
|
[ stem ] map
|
||||||
"vocab:porter-stemmer/test/output.txt" utf8 file-lines
|
"vocab:porter-stemmer/test/output.txt" utf8 file-lines
|
||||||
[ 2array ] 2map [ first2 = not ] filter
|
[ 2array ] 2map [ first2 = ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -191,7 +191,7 @@ M: block section-fits? ( section -- ? )
|
||||||
|
|
||||||
: pprint-sections ( block advancer -- )
|
: pprint-sections ( block advancer -- )
|
||||||
[
|
[
|
||||||
sections>> [ line-break? not ] filter
|
sections>> [ line-break? ] reject
|
||||||
unclip-slice pprint-section
|
unclip-slice pprint-section
|
||||||
] dip
|
] dip
|
||||||
[ [ pprint-section ] bi ] curry each ; inline
|
[ [ pprint-section ] bi ] curry each ; inline
|
||||||
|
|
|
@ -217,7 +217,7 @@ TUPLE: class-partition integers not-integers simples not-simples and or other ;
|
||||||
dup
|
dup
|
||||||
[ simples>> ] [ not-simples>> ] [ and>> ] tri
|
[ simples>> ] [ not-simples>> ] [ and>> ] tri
|
||||||
3append or-class boa
|
3append or-class boa
|
||||||
'[ [ _ class-member? not ] filter ] change-integers ;
|
'[ [ _ class-member? ] reject ] change-integers ;
|
||||||
|
|
||||||
: answer-ands ( partition -- partition' )
|
: answer-ands ( partition -- partition' )
|
||||||
dup [ integers>> ] [ not-simples>> ] [ simples>> ] tri 3append
|
dup [ integers>> ] [ not-simples>> ] [ simples>> ] tri 3append
|
||||||
|
|
|
@ -40,7 +40,7 @@ IN: regexp.dfa
|
||||||
: find-transitions ( dfa-state nfa -- next-dfa-state )
|
: find-transitions ( dfa-state nfa -- next-dfa-state )
|
||||||
transitions>>
|
transitions>>
|
||||||
'[ _ at keys [ condition-states ] map concat ] gather
|
'[ _ at keys [ condition-states ] map concat ] gather
|
||||||
[ tagged-epsilon? not ] filter ;
|
[ tagged-epsilon? ] reject ;
|
||||||
|
|
||||||
: add-todo-state ( state visited-states new-states -- )
|
: add-todo-state ( state visited-states new-states -- )
|
||||||
2over ?adjoin [ nip push ] [ 3drop ] if ;
|
2over ?adjoin [ nip push ] [ 3drop ] if ;
|
||||||
|
|
|
@ -51,7 +51,7 @@ TUPLE: parts in out ;
|
||||||
|
|
||||||
: new-transitions ( transitions -- assoc ) ! assoc is class, partition
|
: new-transitions ( transitions -- assoc ) ! assoc is class, partition
|
||||||
values [ keys ] gather
|
values [ keys ] gather
|
||||||
[ tagged-epsilon? not ] filter
|
[ tagged-epsilon? ] reject
|
||||||
class-partitions ;
|
class-partitions ;
|
||||||
|
|
||||||
: get-transitions ( partition state-transitions -- next-states )
|
: get-transitions ( partition state-transitions -- next-states )
|
||||||
|
|
|
@ -22,7 +22,7 @@ ERROR: bad-class name ;
|
||||||
|
|
||||||
: simple ( str -- simple )
|
: simple ( str -- simple )
|
||||||
! Alternatively, first collation key level?
|
! Alternatively, first collation key level?
|
||||||
>case-fold [ " \t_" member? not ] filter ;
|
>case-fold [ " \t_" member? ] reject ;
|
||||||
|
|
||||||
: simple-table ( seq -- table )
|
: simple-table ( seq -- table )
|
||||||
[ [ simple ] keep ] H{ } map>assoc ;
|
[ [ simple ] keep ] H{ } map>assoc ;
|
||||||
|
|
|
@ -241,7 +241,7 @@ M: word see*
|
||||||
|
|
||||||
: seeing-implementors ( class -- seq )
|
: seeing-implementors ( class -- seq )
|
||||||
dup implementors
|
dup implementors
|
||||||
[ [ reader? ] [ writer? ] bi or not ] filter
|
[ [ reader? ] [ writer? ] bi or ] reject
|
||||||
[ lookup-method ] with map
|
[ lookup-method ] with map
|
||||||
natural-sort ;
|
natural-sort ;
|
||||||
|
|
||||||
|
|
|
@ -409,9 +409,9 @@ DEFER: eee'
|
||||||
! Make sure all primitives are covered
|
! Make sure all primitives are covered
|
||||||
[ { } ] [
|
[ { } ] [
|
||||||
all-words [ primitive? ] filter
|
all-words [ primitive? ] filter
|
||||||
[ "default-output-classes" word-prop not ] filter
|
[ "default-output-classes" word-prop ] reject
|
||||||
[ "special" word-prop not ] filter
|
[ "special" word-prop ] reject
|
||||||
[ "shuffle" word-prop not ] filter
|
[ "shuffle" word-prop ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
{ 1 0 } [ [ drop ] each ] must-infer-as
|
{ 1 0 } [ [ drop ] each ] must-infer-as
|
||||||
|
|
|
@ -62,7 +62,7 @@ M: object uses drop f ;
|
||||||
: defs-to-crossref ( -- seq )
|
: defs-to-crossref ( -- seq )
|
||||||
[
|
[
|
||||||
all-words
|
all-words
|
||||||
[ [ generic? not ] filter ]
|
[ [ generic? ] reject ]
|
||||||
[ [ subwords ] map concat ] bi
|
[ [ subwords ] map concat ] bi
|
||||||
|
|
||||||
all-articles [ >link ] map
|
all-articles [ >link ] map
|
||||||
|
@ -95,7 +95,7 @@ PRIVATE>
|
||||||
|
|
||||||
GENERIC: smart-usage ( defspec -- seq )
|
GENERIC: smart-usage ( defspec -- seq )
|
||||||
|
|
||||||
M: object smart-usage usage [ irrelevant? not ] filter ;
|
M: object smart-usage usage [ irrelevant? ] reject ;
|
||||||
|
|
||||||
M: method smart-usage "method-generic" word-prop smart-usage ;
|
M: method smart-usage "method-generic" word-prop smart-usage ;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ M: f smart-usage drop \ f smart-usage ;
|
||||||
[ "No usages." print ] [ sorted-definitions. ] if-empty ;
|
[ "No usages." print ] [ sorted-definitions. ] if-empty ;
|
||||||
|
|
||||||
: vocab-xref ( vocab quot: ( defspec -- seq ) -- vocabs )
|
: vocab-xref ( vocab quot: ( defspec -- seq ) -- vocabs )
|
||||||
[ [ vocab-name ] [ words [ generic? not ] filter ] bi ] dip map
|
[ [ vocab-name ] [ words [ generic? ] reject ] bi ] dip map
|
||||||
[
|
[
|
||||||
[ [ word? ] [ generic? not ] bi and ] filter [
|
[ [ word? ] [ generic? not ] bi and ] filter [
|
||||||
dup method?
|
dup method?
|
||||||
|
|
|
@ -125,7 +125,7 @@ IN: tools.deploy.shaker
|
||||||
|
|
||||||
: strip-word-defs ( words -- )
|
: strip-word-defs ( words -- )
|
||||||
"Stripping symbolic word definitions" show
|
"Stripping symbolic word definitions" show
|
||||||
[ "no-def-strip" word-prop not ] filter
|
[ "no-def-strip" word-prop ] reject
|
||||||
[ [ ] >>def drop ] each ;
|
[ [ ] >>def drop ] each ;
|
||||||
|
|
||||||
: strip-word-props ( stripped-props words -- )
|
: strip-word-props ( stripped-props words -- )
|
||||||
|
|
|
@ -95,7 +95,7 @@ CONSTANT: zero-counts { 0 0 0 0 0 }
|
||||||
|
|
||||||
:: (collect-subtrees) ( samples max-depth depth child-quot: ( samples -- child ) -- children )
|
:: (collect-subtrees) ( samples max-depth depth child-quot: ( samples -- child ) -- children )
|
||||||
max-depth depth > [
|
max-depth depth > [
|
||||||
samples [ sample-callstack leaf-callstack? not ] filter
|
samples [ sample-callstack leaf-callstack? ] reject
|
||||||
[ f ] [ child-quot call ] if-empty
|
[ f ] [ child-quot call ] if-empty
|
||||||
] [ f ] if ; inline
|
] [ f ] if ; inline
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ PRIVATE>
|
||||||
:: collect-flat ( samples -- flat )
|
:: collect-flat ( samples -- flat )
|
||||||
IH{ } clone :> per-word-samples
|
IH{ } clone :> per-word-samples
|
||||||
samples [| sample |
|
samples [| sample |
|
||||||
sample sample-callstack members [ ignore-word? not ] filter [
|
sample sample-callstack members [ ignore-word? ] reject [
|
||||||
per-word-samples sample counts+at
|
per-word-samples sample counts+at
|
||||||
] each
|
] each
|
||||||
] each
|
] each
|
||||||
|
|
|
@ -216,7 +216,7 @@ M: object add-using ( object -- )
|
||||||
|
|
||||||
: interesting-words ( vocab -- array )
|
: interesting-words ( vocab -- array )
|
||||||
words
|
words
|
||||||
[ { [ "help" word-prop ] [ predicate? ] } 1|| not ] filter
|
[ { [ "help" word-prop ] [ predicate? ] } 1|| ] reject
|
||||||
natural-sort ;
|
natural-sort ;
|
||||||
|
|
||||||
: interesting-words. ( vocab -- )
|
: interesting-words. ( vocab -- )
|
||||||
|
|
|
@ -57,7 +57,7 @@ TUPLE: gadget-metrics height ascent descent cap-height ;
|
||||||
[ descent>> ] map ?supremum ;
|
[ descent>> ] map ?supremum ;
|
||||||
|
|
||||||
: max-graphics-height ( seq -- y )
|
: max-graphics-height ( seq -- y )
|
||||||
[ ascent>> not ] filter [ height>> ] map ?supremum 0 or ;
|
[ ascent>> ] reject [ height>> ] map ?supremum 0 or ;
|
||||||
|
|
||||||
:: combine-metrics ( graphics-height ascent descent cap-height -- ascent' descent' )
|
:: combine-metrics ( graphics-height ascent descent cap-height -- ascent' descent' )
|
||||||
ascent [
|
ascent [
|
||||||
|
|
|
@ -29,7 +29,7 @@ SYMBOL: windows
|
||||||
[ [ length 1 - dup 1 - ] keep exchange ] [ drop ] if ;
|
[ [ length 1 - dup 1 - ] keep exchange ] [ drop ] if ;
|
||||||
|
|
||||||
: unregister-window ( handle -- )
|
: unregister-window ( handle -- )
|
||||||
windows [ [ first = not ] with filter ] change-global ;
|
windows [ [ first = ] with reject ] change-global ;
|
||||||
|
|
||||||
: raised-window ( world -- )
|
: raised-window ( world -- )
|
||||||
windows get-global
|
windows get-global
|
||||||
|
|
|
@ -30,7 +30,7 @@ IN: unicode.breaks.tests
|
||||||
[
|
[
|
||||||
"×" split
|
"×" split
|
||||||
[ [ blank? ] trim hex> ] map
|
[ [ blank? ] trim hex> ] map
|
||||||
[ { f 0 } member? not ] filter
|
[ { f 0 } member? ] reject
|
||||||
>string
|
>string
|
||||||
] map
|
] map
|
||||||
harvest
|
harvest
|
||||||
|
|
|
@ -97,8 +97,8 @@ ducet get-global insert-helpers
|
||||||
] { } map-as concat ;
|
] { } map-as concat ;
|
||||||
|
|
||||||
: append-weights ( weights quot -- )
|
: append-weights ( weights quot -- )
|
||||||
[ [ ignorable?>> not ] filter ] dip
|
[ [ ignorable?>> ] reject ] dip
|
||||||
map [ zero? not ] filter % 0 , ; inline
|
map [ zero? ] reject % 0 , ; inline
|
||||||
|
|
||||||
: variable-weight ( weight -- )
|
: variable-weight ( weight -- )
|
||||||
dup ignorable?>> [ primary>> ] [ drop 0xFFFF ] if , ;
|
dup ignorable?>> [ primary>> ] [ drop 0xFFFF ] if , ;
|
||||||
|
|
|
@ -114,7 +114,7 @@ PRIVATE>
|
||||||
: exclusions ( -- set )
|
: exclusions ( -- set )
|
||||||
exclusions-file utf8 file-lines
|
exclusions-file utf8 file-lines
|
||||||
[ "#" split1 drop [ blank? ] trim-tail hex> ] map
|
[ "#" split1 drop [ blank? ] trim-tail hex> ] map
|
||||||
[ 0 = not ] filter ;
|
[ 0 = ] reject ;
|
||||||
|
|
||||||
: remove-exclusions ( alist -- alist )
|
: remove-exclusions ( alist -- alist )
|
||||||
exclusions unique assoc-diff ;
|
exclusions unique assoc-diff ;
|
||||||
|
@ -129,7 +129,7 @@ PRIVATE>
|
||||||
: process-compatibility ( data -- hash )
|
: process-compatibility ( data -- hash )
|
||||||
(process-decomposed)
|
(process-decomposed)
|
||||||
[ dup first* [ first2 rest 2array ] unless ] map
|
[ dup first* [ first2 rest 2array ] unless ] map
|
||||||
[ second empty? not ] filter
|
[ second empty? ] reject
|
||||||
>hashtable chain-decomposed ;
|
>hashtable chain-decomposed ;
|
||||||
|
|
||||||
: process-combining ( data -- hash )
|
: process-combining ( data -- hash )
|
||||||
|
@ -209,7 +209,7 @@ load-data {
|
||||||
} cleave
|
} cleave
|
||||||
|
|
||||||
combine-map keys [ 2ch> nip ] map
|
combine-map keys [ 2ch> nip ] map
|
||||||
[ combining-class not ] filter
|
[ combining-class ] reject
|
||||||
[ 0 swap class-map set-at ] each
|
[ 0 swap class-map set-at ] each
|
||||||
|
|
||||||
load-special-casing special-casing swap assoc-union! drop
|
load-special-casing special-casing swap assoc-union! drop
|
||||||
|
|
|
@ -48,7 +48,7 @@ IN: uuid
|
||||||
[ CHAR: - 8 ] dip insert-nth ;
|
[ CHAR: - 8 ] dip insert-nth ;
|
||||||
|
|
||||||
: string>uuid ( string -- n )
|
: string>uuid ( string -- n )
|
||||||
[ CHAR: - = not ] filter hex> ;
|
[ CHAR: - = ] reject hex> ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ ERROR: vocab-root-required root ;
|
||||||
[ ensure-vocab-root ] dip
|
[ ensure-vocab-root ] dip
|
||||||
[ ((child-vocabs-recursive)) ] { } make ;
|
[ ((child-vocabs-recursive)) ] { } make ;
|
||||||
|
|
||||||
: no-rooted ( seq -- seq' ) [ find-vocab-root not ] filter ;
|
: no-rooted ( seq -- seq' ) [ find-vocab-root ] reject ;
|
||||||
|
|
||||||
: one-level-only? ( name prefix -- ? )
|
: one-level-only? ( name prefix -- ? )
|
||||||
?head [ "." split1 nip not ] [ drop f ] if ;
|
?head [ "." split1 nip not ] [ drop f ] if ;
|
||||||
|
@ -70,7 +70,7 @@ ERROR: vocab-root-required root ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: no-prefixes ( seq -- seq' ) [ vocab-prefix? not ] filter ;
|
: no-prefixes ( seq -- seq' ) [ vocab-prefix? ] reject ;
|
||||||
|
|
||||||
: convert-prefixes ( seq -- seq' )
|
: convert-prefixes ( seq -- seq' )
|
||||||
[ dup vocab-prefix? [ name>> <vocab-link> ] when ] map ;
|
[ dup vocab-prefix? [ name>> <vocab-link> ] when ] map ;
|
||||||
|
@ -80,7 +80,7 @@ PRIVATE>
|
||||||
[ vocab-prefix? ] partition
|
[ vocab-prefix? ] partition
|
||||||
[
|
[
|
||||||
[ vocab-name ] map fast-set
|
[ vocab-name ] map fast-set
|
||||||
'[ name>> _ in? not ] filter
|
'[ name>> _ in? ] reject
|
||||||
convert-prefixes
|
convert-prefixes
|
||||||
] keep
|
] keep
|
||||||
append ;
|
append ;
|
||||||
|
@ -136,7 +136,7 @@ PRIVATE>
|
||||||
|
|
||||||
: (load-from-root) ( root prefix -- failures )
|
: (load-from-root) ( root prefix -- failures )
|
||||||
vocabs-in-root/prefix
|
vocabs-in-root/prefix
|
||||||
[ don't-load? not ] filter no-prefixes
|
[ don't-load? ] reject no-prefixes
|
||||||
require-all ;
|
require-all ;
|
||||||
|
|
||||||
: load-from-root ( root prefix -- )
|
: load-from-root ( root prefix -- )
|
||||||
|
|
|
@ -108,13 +108,13 @@ ERROR: bad-platform name ;
|
||||||
} 1|| ;
|
} 1|| ;
|
||||||
|
|
||||||
: filter-don't-load ( vocabs -- vocabs' )
|
: filter-don't-load ( vocabs -- vocabs' )
|
||||||
[ vocab-name don't-load? not ] filter ;
|
[ vocab-name don't-load? ] reject ;
|
||||||
|
|
||||||
: don't-test? ( vocab -- ? )
|
: don't-test? ( vocab -- ? )
|
||||||
vocab-tags "not tested" swap member? ;
|
vocab-tags "not tested" swap member? ;
|
||||||
|
|
||||||
: filter-don't-test ( vocabs -- vocabs' )
|
: filter-don't-test ( vocabs -- vocabs' )
|
||||||
[ don't-test? not ] filter ;
|
[ don't-test? ] reject ;
|
||||||
|
|
||||||
TUPLE: unsupported-platform vocab requires ;
|
TUPLE: unsupported-platform vocab requires ;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ IN: vocabs.prettyprint
|
||||||
[ vocab-name ] sort-with ;
|
[ vocab-name ] sort-with ;
|
||||||
|
|
||||||
: pprint-using ( seq -- )
|
: pprint-using ( seq -- )
|
||||||
[ "syntax" lookup-vocab = not ] filter
|
[ "syntax" lookup-vocab = ] reject
|
||||||
sort-vocabs [
|
sort-vocabs [
|
||||||
\ USING: pprint-word
|
\ USING: pprint-word
|
||||||
[ pprint-vocab ] each
|
[ pprint-vocab ] each
|
||||||
|
@ -65,7 +65,7 @@ M: rename pprint-qualified ( rename -- )
|
||||||
] with-pprint ;
|
] with-pprint ;
|
||||||
|
|
||||||
: filter-interesting ( seq -- seq' )
|
: filter-interesting ( seq -- seq' )
|
||||||
[ [ vocab? ] [ extra-words? ] bi or not ] filter ;
|
[ [ vocab? ] [ extra-words? ] bi or ] reject ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ SYMBOL: modified-docs
|
||||||
V{ } clone modified-sources set
|
V{ } clone modified-sources set
|
||||||
V{ } clone modified-docs set
|
V{ } clone modified-docs set
|
||||||
|
|
||||||
child-vocabs [ ".private" tail? not ] filter [
|
child-vocabs [ ".private" tail? ] reject [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
[ modified-sources ]
|
[ modified-sources ]
|
||||||
|
|
|
@ -7,7 +7,7 @@ IN: windows.messages
|
||||||
SYMBOL: windows-messages
|
SYMBOL: windows-messages
|
||||||
|
|
||||||
"windows.messages" words
|
"windows.messages" words
|
||||||
[ name>> "windows-message" head? not ] filter
|
[ name>> "windows-message" head? ] reject
|
||||||
[ dup execute swap ] { } map>assoc
|
[ dup execute swap ] { } map>assoc
|
||||||
windows-messages set-global
|
windows-messages set-global
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ SYMBOL: xml-file
|
||||||
[ ] [ "<?xml version='1.0'?><!-- declarations for <head> & <body> --><foo/>" string>xml drop ] unit-test
|
[ ] [ "<?xml version='1.0'?><!-- declarations for <head> & <body> --><foo/>" string>xml drop ] unit-test
|
||||||
|
|
||||||
: first-thing ( seq -- elt )
|
: first-thing ( seq -- elt )
|
||||||
[ "" = not ] filter first ;
|
[ "" = ] reject first ;
|
||||||
|
|
||||||
[ T{ element-decl f "br" "EMPTY" } ] [ "<!ELEMENT br EMPTY>" string>dtd directives>> first-thing ] unit-test
|
[ T{ element-decl f "br" "EMPTY" } ] [ "<!ELEMENT br EMPTY>" string>dtd directives>> first-thing ] unit-test
|
||||||
[ T{ element-decl f "p" "(#PCDATA|emph)*" } ] [ "<!ELEMENT p (#PCDATA|emph)*>" string>dtd directives>> first-thing ] unit-test
|
[ T{ element-decl f "p" "(#PCDATA|emph)*" } ] [ "<!ELEMENT p (#PCDATA|emph)*>" string>dtd directives>> first-thing ] unit-test
|
||||||
|
|
|
@ -34,7 +34,7 @@ SYMBOL: indentation
|
||||||
: ?filter-children ( children -- no-whitespace )
|
: ?filter-children ( children -- no-whitespace )
|
||||||
xml-pprint? get [
|
xml-pprint? get [
|
||||||
[ dup string? [ [ blank? ] trim ] when ] map
|
[ dup string? [ [ blank? ] trim ] when ] map
|
||||||
[ "" = not ] filter
|
[ "" = ] reject
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
|
@ -32,7 +32,7 @@ M: keyword-map >alist
|
||||||
assoc>> >alist ;
|
assoc>> >alist ;
|
||||||
|
|
||||||
: (keyword-map-no-word-sep) ( assoc -- str )
|
: (keyword-map-no-word-sep) ( assoc -- str )
|
||||||
keys combine [ alpha? not ] filter natural-sort ;
|
keys combine [ alpha? ] reject natural-sort ;
|
||||||
|
|
||||||
: keyword-map-no-word-sep* ( keyword-map -- str )
|
: keyword-map-no-word-sep* ( keyword-map -- str )
|
||||||
dup no-word-sep>> [ ] [
|
dup no-word-sep>> [ ] [
|
||||||
|
|
|
@ -19,7 +19,7 @@ ERROR: not-classoids sequence ;
|
||||||
|
|
||||||
: check-classoids ( members -- members )
|
: check-classoids ( members -- members )
|
||||||
dup [ classoid? ] all?
|
dup [ classoid? ] all?
|
||||||
[ [ classoid? not ] filter not-classoids ] unless ;
|
[ [ classoid? ] reject not-classoids ] unless ;
|
||||||
|
|
||||||
ERROR: not-a-classoid object ;
|
ERROR: not-a-classoid object ;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ ERROR: not-a-classoid object ;
|
||||||
|
|
||||||
: <anonymous-union> ( members -- classoid )
|
: <anonymous-union> ( members -- classoid )
|
||||||
check-classoids
|
check-classoids
|
||||||
[ null eq? not ] filter set-members
|
[ null eq? ] reject set-members
|
||||||
dup length 1 = [ first ] [ sort-classes f like anonymous-union boa ] if ;
|
dup length 1 = [ first ] [ sort-classes f like anonymous-union boa ] if ;
|
||||||
|
|
||||||
M: anonymous-union rank-class drop 6 ;
|
M: anonymous-union rank-class drop 6 ;
|
||||||
|
|
|
@ -200,7 +200,7 @@ M: f fast-set drop 0 <hash-set> ;
|
||||||
M: sequence fast-set >hash-set ;
|
M: sequence fast-set >hash-set ;
|
||||||
|
|
||||||
M: sequence duplicates
|
M: sequence duplicates
|
||||||
dup length <hash-set> [ ?adjoin not ] curry filter ;
|
dup length <hash-set> [ ?adjoin ] curry reject ;
|
||||||
|
|
||||||
M: sequence all-unique?
|
M: sequence all-unique?
|
||||||
dup length <hash-set> [ ?adjoin ] curry all? ;
|
dup length <hash-set> [ ?adjoin ] curry all? ;
|
||||||
|
|
|
@ -8,7 +8,7 @@ IN: hashtables.tests
|
||||||
[ ] [ 1000 iota [ dup sq ] H{ } map>assoc "testhash" set ] unit-test
|
[ ] [ 1000 iota [ dup sq ] H{ } map>assoc "testhash" set ] unit-test
|
||||||
|
|
||||||
[ V{ } ]
|
[ V{ } ]
|
||||||
[ 1000 iota [ dup sq swap "testhash" get at = not ] filter ]
|
[ 1000 iota [ dup sq swap "testhash" get at = ] reject ]
|
||||||
unit-test
|
unit-test
|
||||||
|
|
||||||
[ t ]
|
[ t ]
|
||||||
|
|
|
@ -26,7 +26,7 @@ IN: io.encodings.utf8.tests
|
||||||
|
|
||||||
[ 3 ] [ 2 "lápis" >utf8-index ] unit-test
|
[ 3 ] [ 2 "lápis" >utf8-index ] unit-test
|
||||||
|
|
||||||
[ V{ } ] [ 100000 iota [ [ code-point-length ] [ 1string utf8 encode length ] bi = not ] filter ] unit-test
|
[ V{ } ] [ 100000 iota [ [ code-point-length ] [ 1string utf8 encode length ] bi = ] reject ] unit-test
|
||||||
|
|
||||||
[ { CHAR: replacement-character } ] [ { 0b110,00000 0b10,000000 } decode-utf8-w/stream ] unit-test
|
[ { CHAR: replacement-character } ] [ { 0b110,00000 0b10,000000 } decode-utf8-w/stream ] unit-test
|
||||||
[ { CHAR: replacement-character } ] [ { 0b110,00001 0b10,111111 } decode-utf8-w/stream ] unit-test
|
[ { CHAR: replacement-character } ] [ { 0b110,00001 0b10,111111 } decode-utf8-w/stream ] unit-test
|
||||||
|
|
|
@ -32,7 +32,7 @@ SYMBOL: auto-use?
|
||||||
] [ create-in ] if ;
|
] [ create-in ] if ;
|
||||||
|
|
||||||
: ignore-forwards ( seq -- seq' )
|
: ignore-forwards ( seq -- seq' )
|
||||||
[ forward-reference? not ] filter ;
|
[ forward-reference? ] reject ;
|
||||||
|
|
||||||
: private? ( word -- ? ) vocabulary>> ".private" tail? ;
|
: private? ( word -- ? ) vocabulary>> ".private" tail? ;
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,4 @@ IN: source-files.tests
|
||||||
USING: source-files tools.test assocs sequences strings
|
USING: source-files tools.test assocs sequences strings
|
||||||
namespaces kernel ;
|
namespaces kernel ;
|
||||||
|
|
||||||
[ { } ] [ source-files get keys [ string? not ] filter ] unit-test
|
[ { } ] [ source-files get keys [ string? ] reject ] unit-test
|
||||||
|
|
|
@ -442,11 +442,11 @@ MACRO: fortran-invoke ( return library function parameters -- )
|
||||||
|
|
||||||
SYNTAX: SUBROUTINE:
|
SYNTAX: SUBROUTINE:
|
||||||
f current-library get scan-token ";" parse-tokens
|
f current-library get scan-token ";" parse-tokens
|
||||||
[ "()" subseq? not ] filter define-fortran-function ;
|
[ "()" subseq? ] reject define-fortran-function ;
|
||||||
|
|
||||||
SYNTAX: FUNCTION:
|
SYNTAX: FUNCTION:
|
||||||
scan-token current-library get scan-token ";" parse-tokens
|
scan-token current-library get scan-token ";" parse-tokens
|
||||||
[ "()" subseq? not ] filter define-fortran-function ;
|
[ "()" subseq? ] reject define-fortran-function ;
|
||||||
|
|
||||||
SYNTAX: LIBRARY:
|
SYNTAX: LIBRARY:
|
||||||
scan-token
|
scan-token
|
||||||
|
|
|
@ -19,6 +19,6 @@ IN: elf.nm
|
||||||
: elf-nm ( path -- )
|
: elf-nm ( path -- )
|
||||||
[
|
[
|
||||||
sections dup ".symtab" find-section
|
sections dup ".symtab" find-section
|
||||||
symbols [ name>> empty? not ] filter
|
symbols [ name>> empty? ] reject
|
||||||
[ print-symbol ] with each
|
[ print-symbol ] with each
|
||||||
] with-mapped-elf ;
|
] with-mapped-elf ;
|
||||||
|
|
|
@ -33,7 +33,7 @@ TUPLE: ip-entry from to registry assigned city cntry country ;
|
||||||
|
|
||||||
MEMO: ip-db ( -- seq )
|
MEMO: ip-db ( -- seq )
|
||||||
download-db ascii file-lines
|
download-db ascii file-lines
|
||||||
[ "#" head? not ] filter "\n" join string>csv
|
[ "#" head? ] reject "\n" join string>csv
|
||||||
[ parse-ip-entry ] map ;
|
[ parse-ip-entry ] map ;
|
||||||
|
|
||||||
: filter-overlaps ( alist -- alist' )
|
: filter-overlaps ( alist -- alist' )
|
||||||
|
|
|
@ -120,7 +120,7 @@ Token = Spaces
|
||||||
ExecName |
|
ExecName |
|
||||||
PathName)
|
PathName)
|
||||||
|
|
||||||
Tokens = Token* => [[ [ comment? not ] filter ]]
|
Tokens = Token* => [[ [ comment? ] reject ]]
|
||||||
|
|
||||||
Program = Tokens Spaces !(.) => [[ parse-proc ]]
|
Program = Tokens Spaces !(.) => [[ parse-proc ]]
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ DEFER: uniform-texture-accessors
|
||||||
dup length 1 = [ first swap prefix ] [ [ ] 2sequence ] if ;
|
dup length 1 = [ first swap prefix ] [ [ ] 2sequence ] if ;
|
||||||
|
|
||||||
: uniform-tuple-texture-accessors ( uniform-type -- accessors )
|
: uniform-tuple-texture-accessors ( uniform-type -- accessors )
|
||||||
all-uniform-tuple-slots [ uniform-type>> uniform-type-texture-units zero? not ] filter
|
all-uniform-tuple-slots [ uniform-type>> uniform-type-texture-units zero? ] reject
|
||||||
[ uniform-slot-texture-accessor ] map ;
|
[ uniform-slot-texture-accessor ] map ;
|
||||||
|
|
||||||
: uniform-texture-accessors ( uniform-type dim -- accessors )
|
: uniform-texture-accessors ( uniform-type dim -- accessors )
|
||||||
|
@ -529,7 +529,7 @@ DEFER: [bind-uniform-tuple]
|
||||||
} 3cleave ;
|
} 3cleave ;
|
||||||
|
|
||||||
: true-subclasses ( class -- seq )
|
: true-subclasses ( class -- seq )
|
||||||
[ subclasses ] keep [ = not ] curry filter ;
|
[ subclasses ] keep [ = ] curry reject ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ IN: hashcash
|
||||||
! Random salt is formed by ascii characters
|
! Random salt is formed by ascii characters
|
||||||
! between 33 and 126
|
! between 33 and 126
|
||||||
: available-chars ( -- seq )
|
: available-chars ( -- seq )
|
||||||
33 126 [a,b] [ CHAR: : = not ] filter ;
|
33 126 [a,b] [ CHAR: : = ] reject ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ ERROR: undefined-find-nth m n seq quot ;
|
||||||
[ bl bl bl bl [ write "=" write ] [ write bl ] bi* nl ] assoc-each ;
|
[ bl bl bl bl [ write "=" write ] [ write bl ] bi* nl ] assoc-each ;
|
||||||
|
|
||||||
: form. ( vector -- )
|
: form. ( vector -- )
|
||||||
[ closing?>> not ] filter
|
[ closing?>> ] reject
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
{ [ dup name>> "form" = ]
|
{ [ dup name>> "form" = ]
|
||||||
|
|
|
@ -98,7 +98,7 @@ M: irc-message set-irc-command
|
||||||
] [ drop ] if* ;
|
] [ drop ] if* ;
|
||||||
|
|
||||||
: define-irc-class ( class params -- )
|
: define-irc-class ( class params -- )
|
||||||
[ { ":" "_" } member? not ] filter
|
[ { ":" "_" } member? ] reject
|
||||||
[ irc-message ] dip define-tuple-class ;
|
[ irc-message ] dip define-tuple-class ;
|
||||||
|
|
||||||
: define-irc-parameter-slots ( class params -- )
|
: define-irc-parameter-slots ( class params -- )
|
||||||
|
|
|
@ -232,7 +232,7 @@ SYMBOL: lint-definitions-keys
|
||||||
lintable-words load-definitions
|
lintable-words load-definitions
|
||||||
|
|
||||||
! Remove words that are their own definition
|
! Remove words that are their own definition
|
||||||
[ [ [ def>> ] [ 1quotation ] bi = not ] filter ] assoc-map
|
[ [ [ def>> ] [ 1quotation ] bi = ] reject ] assoc-map
|
||||||
|
|
||||||
! Add manual definitions
|
! Add manual definitions
|
||||||
manual-substitutions over '[ _ push-at ] assoc-each
|
manual-substitutions over '[ _ push-at ] assoc-each
|
||||||
|
@ -284,7 +284,7 @@ GENERIC: run-lint ( obj -- obj )
|
||||||
|
|
||||||
M: sequence run-lint ( seq -- seq )
|
M: sequence run-lint ( seq -- seq )
|
||||||
[ dup lint ] { } map>assoc trim-self
|
[ dup lint ] { } map>assoc trim-self
|
||||||
[ second empty? not ] filter filter-symbols ;
|
[ second empty? ] reject filter-symbols ;
|
||||||
|
|
||||||
M: word run-lint ( word -- seq ) 1array run-lint ;
|
M: word run-lint ( word -- seq ) 1array run-lint ;
|
||||||
|
|
||||||
|
|
|
@ -904,7 +904,7 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands )
|
||||||
[ symtab_command? ] filter ; inline
|
[ symtab_command? ] filter ; inline
|
||||||
|
|
||||||
: read-array-string ( uchar-array -- string )
|
: read-array-string ( uchar-array -- string )
|
||||||
ascii decode [ 0 = not ] filter ;
|
ascii decode [ 0 = ] reject ;
|
||||||
|
|
||||||
: segment-sections ( segment-command -- sections )
|
: segment-sections ( segment-command -- sections )
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
|
||||||
|
|
||||||
:: do-step ( errors summary-file details-file -- )
|
:: do-step ( errors summary-file details-file -- )
|
||||||
errors
|
errors
|
||||||
[ error-type +linkage-error+ eq? not ] filter
|
[ error-type +linkage-error+ eq? ] reject
|
||||||
[ file>> ] map members natural-sort summary-file to-file
|
[ file>> ] map members natural-sort summary-file to-file
|
||||||
errors details-file utf8 [ errors. ] with-file-writer ;
|
errors details-file utf8 [ errors. ] with-file-writer ;
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ PRIVATE>
|
||||||
[ <clumps> ] [ '[ _ count ] map ] bi* ; inline
|
[ <clumps> ] [ '[ _ count ] map ] bi* ; inline
|
||||||
|
|
||||||
: nonzero ( seq -- seq' )
|
: nonzero ( seq -- seq' )
|
||||||
[ zero? not ] filter ;
|
[ zero? ] reject ;
|
||||||
|
|
||||||
: bartlett ( n -- seq )
|
: bartlett ( n -- seq )
|
||||||
dup 1 <= [ 1 = [ 1 1array ] [ { } ] if ] [
|
dup 1 <= [ 1 = [ 1 1array ] [ { } ] if ] [
|
||||||
|
@ -148,10 +148,10 @@ PRIVATE>
|
||||||
0 [ dup fp-nan? [ drop ] [ + ] if ] binary-reduce ;
|
0 [ dup fp-nan? [ drop ] [ + ] if ] binary-reduce ;
|
||||||
|
|
||||||
: nan-min ( seq -- n )
|
: nan-min ( seq -- n )
|
||||||
[ fp-nan? not ] filter infimum ;
|
[ fp-nan? ] reject infimum ;
|
||||||
|
|
||||||
: nan-max ( seq -- n )
|
: nan-max ( seq -- n )
|
||||||
[ fp-nan? not ] filter supremum ;
|
[ fp-nan? ] reject supremum ;
|
||||||
|
|
||||||
: fill-nans ( seq -- newseq )
|
: fill-nans ( seq -- newseq )
|
||||||
[ first ] keep [
|
[ first ] keep [
|
||||||
|
|
|
@ -37,14 +37,14 @@ CONSTANT: otug-slides
|
||||||
"Example:"
|
"Example:"
|
||||||
{ $code
|
{ $code
|
||||||
"\"/etc/passwd\" ascii file-lines"
|
"\"/etc/passwd\" ascii file-lines"
|
||||||
"[ \"#\" head? not ] filter"
|
"[ \"#\" head? ] reject"
|
||||||
"[ \":\" split first ] map"
|
"[ \":\" split first ] map"
|
||||||
"."
|
"."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ $slide "Words"
|
{ $slide "Words"
|
||||||
{ "We can define new words with " { $snippet ": name ... ;" } " syntax" }
|
{ "We can define new words with " { $snippet ": name ... ;" } " syntax" }
|
||||||
{ $code ": remove-comments ( lines -- lines' )" " [ \"#\" head? not ] filter ;" }
|
{ $code ": remove-comments ( lines -- lines' )" " [ \"#\" head? ] reject ;" }
|
||||||
{ "Words are grouped into " { $emphasis "vocabularies" } }
|
{ "Words are grouped into " { $emphasis "vocabularies" } }
|
||||||
{ $link "vocab-index" }
|
{ $link "vocab-index" }
|
||||||
"Libraries and applications are vocabularies"
|
"Libraries and applications are vocabularies"
|
||||||
|
@ -52,13 +52,13 @@ CONSTANT: otug-slides
|
||||||
}
|
}
|
||||||
{ $slide "Constructing quotations"
|
{ $slide "Constructing quotations"
|
||||||
{ "Suppose we want a " { $snippet "remove-comments*" } " word" }
|
{ "Suppose we want a " { $snippet "remove-comments*" } " word" }
|
||||||
{ $code ": remove-comments* ( lines string -- lines' )" " [ ??? head? not ] filter ;" }
|
{ $code ": remove-comments* ( lines string -- lines' )" " [ ??? head? ] reject ;" }
|
||||||
{ "We use " { $link POSTPONE: '[ } " instead of " { $link POSTPONE: [ } }
|
{ "We use " { $link POSTPONE: '[ } " instead of " { $link POSTPONE: [ } }
|
||||||
{ "Create “holes” with " { $link _ } }
|
{ "Create “holes” with " { $link _ } }
|
||||||
"Holes filled in left to right when quotation pushed on the stack"
|
"Holes filled in left to right when quotation pushed on the stack"
|
||||||
}
|
}
|
||||||
{ $slide "Constructing quotations"
|
{ $slide "Constructing quotations"
|
||||||
{ $code ": remove-comments* ( lines string -- lines' )" " '[ _ head? not ] filter ;" "" ": remove-comments ( lines -- lines' )" " \"#\" remove-comments* ;" }
|
{ $code ": remove-comments* ( lines string -- lines' )" " '[ _ head? ] reject ;" "" ": remove-comments ( lines -- lines' )" " \"#\" remove-comments* ;" }
|
||||||
{ { $link @ } " inserts a quotation" }
|
{ { $link @ } " inserts a quotation" }
|
||||||
{ $code ": replicate ( n quot -- seq )" " '[ drop @ ] map ;" }
|
{ $code ": replicate ( n quot -- seq )" " '[ drop @ ] map ;" }
|
||||||
{ $code "10 [ 1 10 [a,b] random ] replicate ." }
|
{ $code "10 [ 1 10 [a,b] random ] replicate ." }
|
||||||
|
|
|
@ -21,7 +21,7 @@ IN: project-euler.004
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: source-004 ( -- seq )
|
: source-004 ( -- seq )
|
||||||
100 999 [a,b] [ 10 divisor? not ] filter ;
|
100 999 [a,b] [ 10 divisor? ] reject ;
|
||||||
|
|
||||||
: max-palindrome ( seq -- palindrome )
|
: max-palindrome ( seq -- palindrome )
|
||||||
natural-sort [ palindrome? ] find-last nip ;
|
natural-sort [ palindrome? ] find-last nip ;
|
||||||
|
|
|
@ -39,7 +39,7 @@ IN: project-euler.079
|
||||||
[ "Topological sort failed" throw ] [ first ] if-empty ;
|
[ "Topological sort failed" throw ] [ first ] if-empty ;
|
||||||
|
|
||||||
: remove-source ( seq elt -- seq )
|
: remove-source ( seq elt -- seq )
|
||||||
[ swap member? not ] curry filter ;
|
[ swap member? ] curry reject ;
|
||||||
|
|
||||||
: (topological-sort) ( seq -- )
|
: (topological-sort) ( seq -- )
|
||||||
dup length 1 > [
|
dup length 1 > [
|
||||||
|
|
|
@ -90,7 +90,7 @@ PRIVATE>
|
||||||
[ <resolv.conf> ] dip
|
[ <resolv.conf> ] dip
|
||||||
utf8 file-lines
|
utf8 file-lines
|
||||||
[ [ blank? ] trim ] map harvest
|
[ [ blank? ] trim ] map harvest
|
||||||
[ "#" head? not ] filter
|
[ "#" head? ] reject
|
||||||
[ parse-resolv.conf-line ] each ;
|
[ parse-resolv.conf-line ] each ;
|
||||||
|
|
||||||
: default-resolv.conf ( -- resolv.conf )
|
: default-resolv.conf ( -- resolv.conf )
|
||||||
|
|
|
@ -35,7 +35,7 @@ visit-time request-rate crawl-delay unknowns ;
|
||||||
: normalize-robots.txt ( string -- sitemaps seq )
|
: normalize-robots.txt ( string -- sitemaps seq )
|
||||||
string-lines
|
string-lines
|
||||||
[ [ blank? ] trim ] map
|
[ [ blank? ] trim ] map
|
||||||
[ "#" head? not ] filter harvest
|
[ "#" head? ] reject harvest
|
||||||
[ ":" split1 [ [ blank? ] trim ] bi@ [ >lower ] dip ] { } map>assoc
|
[ ":" split1 [ [ blank? ] trim ] bi@ [ >lower ] dip ] { } map>assoc
|
||||||
[ first "sitemap" = ] partition [ values ] dip
|
[ first "sitemap" = ] partition [ values ] dip
|
||||||
[
|
[
|
||||||
|
|
|
@ -257,7 +257,7 @@ PRIVATE>
|
||||||
[ empty? not ] swap filter-as ;
|
[ empty? not ] swap filter-as ;
|
||||||
|
|
||||||
: harvest! ( seq -- newseq )
|
: harvest! ( seq -- newseq )
|
||||||
[ empty? not ] filter! ;
|
[ empty? ] reject! ;
|
||||||
|
|
||||||
: head-as ( seq n exemplar -- seq' )
|
: head-as ( seq n exemplar -- seq' )
|
||||||
[ head-slice ] [ like ] bi* ; inline
|
[ head-slice ] [ like ] bi* ; inline
|
||||||
|
|
|
@ -72,7 +72,7 @@ IN: tools.gc-decode.tests
|
||||||
|
|
||||||
{ { } } [
|
{ { } } [
|
||||||
all-words [ normal? ] filter 50 sample
|
all-words [ normal? ] filter 50 sample
|
||||||
[ [ word>gc-info-expected ] [ word>gc-info ] bi same-gc-info? not ] filter
|
[ [ word>gc-info-expected ] [ word>gc-info ] bi same-gc-info? ] reject
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
: base-pointer-groups-expected ( word -- seq )
|
: base-pointer-groups-expected ( word -- seq )
|
||||||
|
|
|
@ -60,8 +60,8 @@ CONSTANT: video-info-url URL" http://www.youtube.com/get_video_info"
|
||||||
[ "url" of ] [ "sig" of ] bi "&signature=" glue ;
|
[ "url" of ] [ "sig" of ] bi "&signature=" glue ;
|
||||||
|
|
||||||
: sanitize ( title -- title' )
|
: sanitize ( title -- title' )
|
||||||
[ 0 31 between? not ] filter
|
[ 0 31 between? ] reject
|
||||||
[ "\"#$%'*,./:;<>?^|~\\" member? not ] filter
|
[ "\"#$%'*,./:;<>?^|~\\" member? ] reject
|
||||||
200 short head ;
|
200 short head ;
|
||||||
|
|
||||||
: download-video ( video-id -- )
|
: download-video ( video-id -- )
|
||||||
|
|
|
@ -86,7 +86,7 @@ SYMBOL: matrix
|
||||||
[ 0 0 (echelon) ] with-matrix ;
|
[ 0 0 (echelon) ] with-matrix ;
|
||||||
|
|
||||||
: nonzero-rows ( matrix -- matrix' )
|
: nonzero-rows ( matrix -- matrix' )
|
||||||
[ [ zero? ] all? not ] filter ;
|
[ [ zero? ] all? ] reject ;
|
||||||
|
|
||||||
: null/rank ( matrix -- null rank )
|
: null/rank ( matrix -- null rank )
|
||||||
echelon dup length swap nonzero-rows length [ - ] keep ;
|
echelon dup length swap nonzero-rows length [ - ] keep ;
|
||||||
|
|
|
@ -51,7 +51,7 @@ PRIVATE>
|
||||||
|
|
||||||
: function-types-effect ( -- function types effect )
|
: function-types-effect ( -- function types effect )
|
||||||
scan scan swap ")" parse-tokens
|
scan scan swap ")" parse-tokens
|
||||||
[ "(" subseq? not ] filter swap parse-arglist ;
|
[ "(" subseq? ] reject swap parse-arglist ;
|
||||||
|
|
||||||
: prototype-string ( function types effect -- str )
|
: prototype-string ( function types effect -- str )
|
||||||
[ [ cify-type ] map ] dip
|
[ [ cify-type ] map ] dip
|
||||||
|
|
Loading…
Reference in New Issue