factor: rename classes:members to class-members so it doesn't conflict with sets:members. ugh.

db4
Doug Coleman 2015-07-20 00:32:42 -07:00
parent fbbd09f3c5
commit 2adeed9cb3
19 changed files with 29 additions and 46 deletions

View File

@ -3,10 +3,8 @@
USING: accessors arrays assocs combinators compiler.cfg USING: accessors arrays assocs combinators compiler.cfg
compiler.cfg.instructions compiler.cfg.instructions.syntax compiler.cfg.instructions compiler.cfg.instructions.syntax
compiler.cfg.rpo compiler.units fry generic kernel namespaces compiler.cfg.rpo compiler.units fry generic kernel namespaces
quotations sequences sequences.generalizations sets slots words quotations sequences sequences.generalizations sets slots words ;
;
FROM: namespaces => set ; FROM: namespaces => set ;
FROM: sets => members ;
IN: compiler.cfg.def-use IN: compiler.cfg.def-use
! Utilities for iterating over instruction operands ! Utilities for iterating over instruction operands

View File

@ -10,7 +10,7 @@ namespaces quotations sequences sequences.generalizations
sequences.private sets sets.private stack-checker sequences.private sets sets.private stack-checker
stack-checker.dependencies vectors words ; stack-checker.dependencies vectors words ;
FROM: math => float ; FROM: math => float ;
FROM: sets => set members ; FROM: sets => set ;
IN: compiler.tree.propagation.transforms IN: compiler.tree.propagation.transforms
\ equal? [ \ equal? [

View File

@ -7,7 +7,6 @@ help.markup help.topics io io.streams.string kernel macros math
namespaces sequences sequences.deep sets splitting strings namespaces sequences sequences.deep sets splitting strings
summary tools.destructors unicode.categories vocabs summary tools.destructors unicode.categories vocabs
vocabs.loader words words.constant words.symbol ; vocabs.loader words words.constant words.symbol ;
FROM: sets => members ;
IN: help.lint.checks IN: help.lint.checks
ERROR: simple-lint-error message ; ERROR: simple-lint-error message ;

View File

@ -4,7 +4,6 @@ USING: accessors classes.maybe combinators
combinators.short-circuit continuations hashtables io io.styles combinators.short-circuit continuations hashtables io io.styles
kernel make math namespaces prettyprint.config sequences sets kernel make math namespaces prettyprint.config sequences sets
splitting strings vocabs vocabs.parser words ; splitting strings vocabs vocabs.parser words ;
FROM: sets => members ;
FROM: namespaces => set ; FROM: namespaces => set ;
IN: prettyprint.sections IN: prettyprint.sections

View File

@ -5,7 +5,6 @@ combinators.smart combinators.short-circuit locals
unicode.categories sequences fry macros arrays assocs sets unicode.categories sequences fry macros arrays assocs sets
classes unicode.script unicode.data ; classes unicode.script unicode.data ;
FROM: ascii => ascii? ; FROM: ascii => ascii? ;
FROM: sets => members ;
IN: regexp.classes IN: regexp.classes
SINGLETONS: dot letter-class LETTER-class Letter-class digit-class SINGLETONS: dot letter-class LETTER-class Letter-class digit-class

View File

@ -9,8 +9,6 @@ prettyprint.backend prettyprint.config prettyprint.custom
prettyprint.sections sequences sets slots sorting strings summary prettyprint.sections sequences sets slots sorting strings summary
words words.symbol words.constant words.alias vocabs ; words words.symbol words.constant words.alias vocabs ;
FROM: namespaces => set ; FROM: namespaces => set ;
FROM: classes => members ;
RENAME: members sets => set-members
IN: see IN: see
GENERIC: synopsis* ( defspec -- ) GENERIC: synopsis* ( defspec -- )
@ -142,17 +140,17 @@ GENERIC: see-class* ( word -- )
M: union-class see-class* M: union-class see-class*
<colon \ UNION: pprint-word <colon \ UNION: pprint-word
dup pprint-word dup pprint-word
members pprint-elements pprint-; block> ; class-members pprint-elements pprint-; block> ;
M: intersection-class see-class* M: intersection-class see-class*
<colon \ INTERSECTION: pprint-word <colon \ INTERSECTION: pprint-word
dup pprint-word dup pprint-word
participants pprint-elements pprint-; block> ; class-participants pprint-elements pprint-; block> ;
M: mixin-class see-class* M: mixin-class see-class*
<block \ MIXIN: pprint-word <block \ MIXIN: pprint-word
dup pprint-word <block dup pprint-word <block
dup members [ dup class-members [
hard add-line-break hard add-line-break
\ INSTANCE: pprint-word pprint-word pprint-word \ INSTANCE: pprint-word pprint-word pprint-word
] with each block> block> ; ] with each block> block> ;
@ -258,7 +256,7 @@ PRIVATE>
dup class? [ dup seeing-implementors % ] when dup class? [ dup seeing-implementors % ] when
dup generic? [ dup seeing-methods % ] when dup generic? [ dup seeing-methods % ] when
drop drop
] { } make set-members ; ] { } make members ;
: see-methods ( word -- ) : see-methods ( word -- )
methods see-all nl ; methods see-all nl ;

View File

@ -26,7 +26,6 @@ QUALIFIED: vocabs.loader
FROM: assocs => change-at ; FROM: assocs => change-at ;
FROM: namespaces => set ; FROM: namespaces => set ;
FROM: sequences => change-nth ; FROM: sequences => change-nth ;
FROM: sets => members ;
IN: tools.deploy.shaker IN: tools.deploy.shaker
! This file is some hairy shit. ! This file is some hairy shit.

View File

@ -3,7 +3,6 @@
USING: accessors arrays assocs classes combinators.smart USING: accessors arrays assocs classes combinators.smart
continuations destructors fry io io.styles kernel namespaces continuations destructors fry io io.styles kernel namespaces
prettyprint sequences sets sorting ; prettyprint sequences sets sorting ;
FROM: sets => members ;
IN: tools.destructors IN: tools.destructors
<PRIVATE <PRIVATE

View File

@ -7,7 +7,6 @@ io.files io.pathnames io.streams.string kernel math math.parser
namespaces prettyprint quotations sequences sets sorting namespaces prettyprint quotations sequences sets sorting
splitting strings system timers unicode.categories urls vocabs splitting strings system timers unicode.categories urls vocabs
vocabs.loader vocabs.metadata words words.symbol ; vocabs.loader vocabs.metadata words words.symbol ;
FROM: sets => members ;
IN: tools.scaffold IN: tools.scaffold
SYMBOL: developer-name SYMBOL: developer-name

View File

@ -6,7 +6,6 @@ math.vectors classes.tuple classes boxes calendar timers combinators
sets columns fry deques ui.gadgets ui.gadgets.private ascii sets columns fry deques ui.gadgets ui.gadgets.private ascii
combinators.short-circuit ; combinators.short-circuit ;
FROM: namespaces => set ; FROM: namespaces => set ;
FROM: sets => members ;
IN: ui.gestures IN: ui.gestures
: get-gesture-handler ( gesture gadget -- quot ) : get-gesture-handler ( gesture gadget -- quot )

View File

@ -2,9 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs classes classes.private USING: accessors arrays assocs classes classes.private
combinators kernel make math math.order namespaces sequences combinators kernel make math math.order namespaces sequences
sorting vectors words ; sets sorting vectors words ;
FROM: classes => members ;
RENAME: members sets => set-members
IN: classes.algebra IN: classes.algebra
DEFER: sort-classes DEFER: sort-classes
@ -28,7 +26,7 @@ ERROR: not-a-classoid object ;
: <anonymous-union> ( members -- classoid ) : <anonymous-union> ( members -- classoid )
check-classoids check-classoids
[ null eq? ] reject set-members [ null eq? ] reject 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 ;
@ -39,7 +37,7 @@ INSTANCE: anonymous-intersection classoid
: <anonymous-intersection> ( participants -- classoid ) : <anonymous-intersection> ( participants -- classoid )
check-classoids check-classoids
set-members dup length 1 = members dup length 1 =
[ first ] [ sort-classes f like anonymous-intersection boa ] if ; [ first ] [ sort-classes f like anonymous-intersection boa ] if ;
M: anonymous-intersection rank-class drop 4 ; M: anonymous-intersection rank-class drop 4 ;
@ -140,7 +138,7 @@ SYMBOL: +incomparable+
[ members>> ] dip [ class<= ] curry all? ; [ members>> ] dip [ class<= ] curry all? ;
: right-union<= ( first second -- ? ) : right-union<= ( first second -- ? )
members [ class<= ] with any? ; class-members [ class<= ] with any? ;
: right-anonymous-union<= ( first second -- ? ) : right-anonymous-union<= ( first second -- ? )
members>> [ class<= ] with any? ; members>> [ class<= ] with any? ;
@ -179,8 +177,8 @@ PREDICATE: nontrivial-anonymous-complement < anonymous-complement
class>> { class>> {
[ anonymous-union? ] [ anonymous-union? ]
[ anonymous-intersection? ] [ anonymous-intersection? ]
[ members ] [ class-members ]
[ participants ] [ class-participants ]
} cleave or or or ; } cleave or or or ;
PREDICATE: empty-union < anonymous-union members>> empty? ; PREDICATE: empty-union < anonymous-union members>> empty? ;
@ -199,7 +197,7 @@ PREDICATE: empty-intersection < anonymous-intersection participants>> empty? ;
{ [ over anonymous-union? ] [ left-anonymous-union<= ] } { [ over anonymous-union? ] [ left-anonymous-union<= ] }
{ [ over nontrivial-anonymous-intersection? ] [ left-anonymous-intersection<= ] } { [ over nontrivial-anonymous-intersection? ] [ left-anonymous-intersection<= ] }
{ [ over nontrivial-anonymous-complement? ] [ left-anonymous-complement<= ] } { [ over nontrivial-anonymous-complement? ] [ left-anonymous-complement<= ] }
{ [ dup members ] [ right-union<= ] } { [ dup class-members ] [ right-union<= ] }
{ [ dup anonymous-union? ] [ right-anonymous-union<= ] } { [ dup anonymous-union? ] [ right-anonymous-union<= ] }
{ [ dup anonymous-intersection? ] [ right-anonymous-intersection<= ] } { [ dup anonymous-intersection? ] [ right-anonymous-intersection<= ] }
{ [ dup anonymous-complement? ] [ class>> classes-intersect? not ] } { [ dup anonymous-complement? ] [ class>> classes-intersect? not ] }

View File

@ -115,11 +115,11 @@ M: predicate reset-word
: subclass-of? ( class superclass -- ? ) : subclass-of? ( class superclass -- ? )
swap superclass-of? ; swap superclass-of? ;
: members ( class -- seq ) : class-members ( class -- seq )
#! Output f for non-classes to work with algebra code #! Output f for non-classes to work with algebra code
dup class? [ "members" word-prop ] [ drop f ] if ; dup class? [ "members" word-prop ] [ drop f ] if ;
: participants ( class -- seq ) : class-participants ( class -- seq )
#! Output f for non-classes to work with algebra code #! Output f for non-classes to work with algebra code
dup class? [ "participants" word-prop ] [ drop f ] if ; dup class? [ "participants" word-prop ] [ drop f ] if ;
@ -128,8 +128,8 @@ GENERIC: implementors ( class/classes -- seq )
! update-map ! update-map
: class-uses ( class -- seq ) : class-uses ( class -- seq )
[ [
[ members % ] [ class-members % ]
[ participants % ] [ class-participants % ]
[ superclass [ , ] when* ] [ superclass [ , ] when* ]
tri tri
] { } make ; ] { } make ;

View File

@ -21,7 +21,7 @@ PREDICATE: intersection-class < class
] if-empty ; ] if-empty ;
: define-intersection-predicate ( class -- ) : define-intersection-predicate ( class -- )
dup participants intersection-predicate-quot define-predicate ; dup class-participants intersection-predicate-quot define-predicate ;
M: intersection-class update-class define-intersection-predicate ; M: intersection-class update-class define-intersection-predicate ;
@ -34,10 +34,10 @@ M: anonymous-intersection instance?
participants>> [ instance? ] with all? ; participants>> [ instance? ] with all? ;
M: intersection-class normalize-class M: intersection-class normalize-class
participants <anonymous-intersection> normalize-class ; class-participants <anonymous-intersection> normalize-class ;
M: intersection-class (flatten-class) M: intersection-class (flatten-class)
participants <anonymous-intersection> (flatten-class) ; class-participants <anonymous-intersection> (flatten-class) ;
! Horribly inefficient and inaccurate ! Horribly inefficient and inaccurate
: intersect-flattened-classes ( seq1 seq2 -- seq3 ) : intersect-flattened-classes ( seq1 seq2 -- seq3 )

View File

@ -11,7 +11,7 @@ PREDICATE: mixin-class < union-class "mixin" word-prop ;
M: mixin-class normalize-class ; M: mixin-class normalize-class ;
M: mixin-class (classes-intersect?) M: mixin-class (classes-intersect?)
members [ classes-intersect? ] with any? ; class-members [ classes-intersect? ] with any? ;
M: mixin-class reset-class M: mixin-class reset-class
[ call-next-method ] [ "mixin" remove-word-prop ] bi ; [ call-next-method ] [ "mixin" remove-word-prop ] bi ;
@ -34,10 +34,10 @@ ERROR: check-mixin-class-error class ;
2tri ; 2tri ;
: if-mixin-member? ( class mixin true false -- ) : if-mixin-member? ( class mixin true false -- )
[ check-mixin-class 2dup members member-eq? ] 2dip if ; inline [ check-mixin-class 2dup class-members member-eq? ] 2dip if ; inline
: change-mixin-class ( class mixin quot -- ) : change-mixin-class ( class mixin quot -- )
[ [ members swap bootstrap-word ] dip call ] [ drop ] 2bi [ [ class-members swap bootstrap-word ] dip call ] [ drop ] 2bi
swap redefine-mixin-class ; inline swap redefine-mixin-class ; inline
: (add-mixin-instance) ( class mixin -- ) : (add-mixin-instance) ( class mixin -- )

View File

@ -17,7 +17,7 @@ GENERIC: union-of-builtins? ( class -- ? )
M: builtin-class union-of-builtins? drop t ; M: builtin-class union-of-builtins? drop t ;
M: union-class union-of-builtins? M: union-class union-of-builtins?
members [ union-of-builtins? ] all? ; class-members [ union-of-builtins? ] all? ;
M: class union-of-builtins? M: class union-of-builtins?
drop f ; drop f ;
@ -36,12 +36,12 @@ M: class union-of-builtins?
surround ; surround ;
: slow-union-predicate-quot ( class -- quot ) : slow-union-predicate-quot ( class -- quot )
members [ predicate-def ] map unclip swap class-members [ predicate-def ] map unclip swap
[ [ dup ] prepend [ drop t ] ] { } map>assoc alist>quot ; [ [ dup ] prepend [ drop t ] ] { } map>assoc alist>quot ;
: union-predicate-quot ( class -- quot ) : union-predicate-quot ( class -- quot )
{ {
{ [ dup members empty? ] [ empty-union-predicate-quot ] } { [ dup class-members empty? ] [ empty-union-predicate-quot ] }
{ [ dup union-of-builtins? ] [ fast-union-predicate-quot ] } { [ dup union-of-builtins? ] [ fast-union-predicate-quot ] }
[ slow-union-predicate-quot ] [ slow-union-predicate-quot ]
} cond ; } cond ;
@ -91,7 +91,7 @@ M: anonymous-union class-name
members>> [ class-name ] map " " join ; members>> [ class-name ] map " " join ;
M: union-class normalize-class M: union-class normalize-class
members <anonymous-union> normalize-class ; class-members <anonymous-union> normalize-class ;
M: union-class (flatten-class) M: union-class (flatten-class)
members <anonymous-union> (flatten-class) ; class-members <anonymous-union> (flatten-class) ;

View File

@ -5,7 +5,6 @@ classes.tuple classes.tuple.private continuations definitions
generic hash-sets init kernel kernel.private math namespaces generic hash-sets init kernel kernel.private math namespaces
sequences sets source-files.errors vocabs words ; sequences sets source-files.errors vocabs words ;
FROM: namespaces => set ; FROM: namespaces => set ;
FROM: sets => members ;
IN: compiler.units IN: compiler.units
PRIMITIVE: modify-code-heap ( alist update-existing? reset-pics? -- ) PRIMITIVE: modify-code-heap ( alist update-existing? reset-pics? -- )

View File

@ -4,7 +4,6 @@ USING: accessors arrays assocs classes classes.algebra
classes.algebra.private classes.maybe classes.private classes.algebra.private classes.maybe classes.private
combinators definitions kernel make namespaces sequences sets combinators definitions kernel make namespaces sequences sets
words ; words ;
FROM: sets => members ;
IN: generic IN: generic
! Method combination protocol ! Method combination protocol

View File

@ -5,7 +5,6 @@ compiler.units continuations definitions effects io
io.encodings.utf8 io.files kernel lexer math.parser namespaces io.encodings.utf8 io.files kernel lexer math.parser namespaces
parser.notes quotations sequences sets slots source-files parser.notes quotations sequences sets slots source-files
vectors vocabs vocabs.parser words words.symbol ; vectors vocabs vocabs.parser words words.symbol ;
FROM: sets => members ;
IN: parser IN: parser
: location ( -- loc ) : location ( -- loc )

View File

@ -2,8 +2,7 @@
! See http://factorcode.org/license.txt for BSD license ! See http://factorcode.org/license.txt for BSD license
USING: ascii assocs fry io.encodings.ascii io.files kernel math USING: ascii assocs fry io.encodings.ascii io.files kernel math
math.statistics memoize sequences sequences.extras sorting ; math.statistics memoize sequences sequences.extras sorting sets ;
FROM: sets => members ;
IN: anagrams IN: anagrams
: make-anagram-hash ( strings -- assoc ) : make-anagram-hash ( strings -- assoc )