Handbook
Glossary
sort-classes ( seq -- newseq )
Factor handbook
»
The language
»
Objects
»
Classes
»
Class linearization
Prev:
class< ( first second -- ? )
Next:
smallest-class ( classes -- class/f )
Vocabulary
classes
.
algebra
Inputs
seq
a
sequence
of
class
s
Outputs
newseq
a
sequence
of
class
s
Word description
Outputs a linear sort of a sequence of classes. Larger classes come before their subclasses.
See also
dispatch-order
Definition
USING:
classes.private
kernel
sequences
sorting
vectors
;
IN:
classes.algebra
:
sort-classes
( seq -- newseq )
[
class-name
]
sort-by
>vector
[
dup
empty?
not
]
[
dup
largest-class
[
swap
remove-nth!
]
dip
]
produce
nip
;