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
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? [
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 ;
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
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
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 -- )
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> ;
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 ;
FROM: assocs => change-at ;
FROM: namespaces => set ;
FROM: sequences => change-nth ;
-FROM: sets => members ;
IN: tools.deploy.shaker
! This file is some hairy shit.
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
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
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 )
! 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
: <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 ;
: <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 ;
[ 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? ;
class>> {
[ anonymous-union? ]
[ anonymous-intersection? ]
- [ members ]
- [ participants ]
+ [ class-members ]
+ [ class-participants ]
} cleave or or or ;
PREDICATE: empty-union < anonymous-union members>> 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 ] }
: 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 ;
! update-map
: class-uses ( class -- seq )
[
- [ members % ]
- [ participants % ]
+ [ class-members % ]
+ [ class-participants % ]
[ superclass [ , ] when* ]
tri
] { } make ;
] 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 ;
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 )
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 ;
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 -- )
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 ;
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 ;
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) ;
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? -- )
classes.algebra.private classes.maybe classes.private
combinators definitions kernel make namespaces sequences sets
words ;
-FROM: sets => members ;
IN: generic
! Method combination protocol
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 )
! 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 )