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
compiler.cfg.instructions compiler.cfg.instructions.syntax
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: sets => members ;
IN: compiler.cfg.def-use
! Utilities for iterating over instruction operands

View File

@ -10,7 +10,7 @@ namespaces quotations sequences sequences.generalizations
sequences.private sets sets.private stack-checker
stack-checker.dependencies vectors words ;
FROM: math => float ;
FROM: sets => set members ;
FROM: sets => set ;
IN: compiler.tree.propagation.transforms
\ 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
summary tools.destructors unicode.categories vocabs
vocabs.loader words words.constant words.symbol ;
FROM: sets => members ;
IN: help.lint.checks
ERROR: simple-lint-error message ;

View File

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

View File

@ -5,7 +5,6 @@ combinators.smart combinators.short-circuit locals
unicode.categories sequences fry macros arrays assocs sets
classes unicode.script unicode.data ;
FROM: ascii => ascii? ;
FROM: sets => members ;
IN: regexp.classes
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
words words.symbol words.constant words.alias vocabs ;
FROM: namespaces => set ;
FROM: classes => members ;
RENAME: members sets => set-members
IN: see
GENERIC: synopsis* ( defspec -- )
@ -142,17 +140,17 @@ GENERIC: see-class* ( word -- )
M: union-class see-class*
<colon \ UNION: pprint-word
dup pprint-word
members pprint-elements pprint-; block> ;
class-members pprint-elements pprint-; block> ;
M: intersection-class see-class*
<colon \ INTERSECTION: pprint-word
dup pprint-word
participants pprint-elements pprint-; block> ;
class-participants pprint-elements pprint-; block> ;
M: mixin-class see-class*
<block \ MIXIN: pprint-word
dup pprint-word <block
dup members [
dup class-members [
hard add-line-break
\ INSTANCE: pprint-word pprint-word pprint-word
] with each block> block> ;
@ -258,7 +256,7 @@ PRIVATE>
dup class? [ dup seeing-implementors % ] when
dup generic? [ dup seeing-methods % ] when
drop
] { } make set-members ;
] { } make members ;
: see-methods ( word -- )
methods see-all nl ;

View File

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

View File

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

View File

@ -7,7 +7,6 @@ io.files io.pathnames io.streams.string kernel math math.parser
namespaces prettyprint quotations sequences sets sorting
splitting strings system timers unicode.categories urls vocabs
vocabs.loader vocabs.metadata words words.symbol ;
FROM: sets => members ;
IN: tools.scaffold
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
combinators.short-circuit ;
FROM: namespaces => set ;
FROM: sets => members ;
IN: ui.gestures
: get-gesture-handler ( gesture gadget -- quot )

View File

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

View File

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

View File

@ -21,7 +21,7 @@ PREDICATE: intersection-class < class
] if-empty ;
: 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 ;
@ -34,10 +34,10 @@ M: anonymous-intersection instance?
participants>> [ instance? ] with all? ;
M: intersection-class normalize-class
participants <anonymous-intersection> normalize-class ;
class-participants <anonymous-intersection> normalize-class ;
M: intersection-class (flatten-class)
participants <anonymous-intersection> (flatten-class) ;
class-participants <anonymous-intersection> (flatten-class) ;
! Horribly inefficient and inaccurate
: 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 (classes-intersect?)
members [ classes-intersect? ] with any? ;
class-members [ classes-intersect? ] with any? ;
M: mixin-class reset-class
[ call-next-method ] [ "mixin" remove-word-prop ] bi ;
@ -34,10 +34,10 @@ ERROR: check-mixin-class-error class ;
2tri ;
: 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 -- )
[ [ members swap bootstrap-word ] dip call ] [ drop ] 2bi
[ [ class-members swap bootstrap-word ] dip call ] [ drop ] 2bi
swap redefine-mixin-class ; inline
: (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: union-class union-of-builtins?
members [ union-of-builtins? ] all? ;
class-members [ union-of-builtins? ] all? ;
M: class union-of-builtins?
drop f ;
@ -36,12 +36,12 @@ M: class union-of-builtins?
surround ;
: 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 ;
: 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 ] }
[ slow-union-predicate-quot ]
} cond ;
@ -91,7 +91,7 @@ M: anonymous-union class-name
members>> [ class-name ] map " " join ;
M: union-class normalize-class
members <anonymous-union> normalize-class ;
class-members <anonymous-union> normalize-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
sequences sets source-files.errors vocabs words ;
FROM: namespaces => set ;
FROM: sets => members ;
IN: compiler.units
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
combinators definitions kernel make namespaces sequences sets
words ;
FROM: sets => members ;
IN: generic
! 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
parser.notes quotations sequences sets slots source-files
vectors vocabs vocabs.parser words words.symbol ;
FROM: sets => members ;
IN: parser
: location ( -- loc )

View File

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