vocabs.hierarchy: change sorting to sort visible-dirs.
parent
1a1ee4b4a8
commit
4e91f55f1e
|
@ -18,7 +18,7 @@ M: vocab-prefix vocab-name name>> ;
|
||||||
{ [ directory? ] [ name>> "." head? not ] } 1&& ;
|
{ [ directory? ] [ name>> "." head? not ] } 1&& ;
|
||||||
|
|
||||||
: visible-dirs ( seq -- seq' )
|
: visible-dirs ( seq -- seq' )
|
||||||
[ visible-dir? ] filter ;
|
[ visible-dir? ] filter [ name>> ] sort-with ;
|
||||||
|
|
||||||
ERROR: vocab-root-required root ;
|
ERROR: vocab-root-required root ;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ ERROR: vocab-root-required root ;
|
||||||
over dup exists? [ directory-entries ] [ drop { } ] if ;
|
over dup exists? [ directory-entries ] [ drop { } ] if ;
|
||||||
|
|
||||||
: (disk-vocabs) ( root prefix -- seq )
|
: (disk-vocabs) ( root prefix -- seq )
|
||||||
vocab-directory-entries visible-dirs [ name>> ] sort-with [
|
vocab-directory-entries visible-dirs [
|
||||||
name>>
|
name>>
|
||||||
[ dup ".factor" append append-path append-path ]
|
[ dup ".factor" append append-path append-path ]
|
||||||
[ over empty? [ nip ] [ "." glue ] if ] bi-curry bi*
|
[ over empty? [ nip ] [ "." glue ] if ] bi-curry bi*
|
||||||
|
@ -56,8 +56,7 @@ DEFER: add-vocab%
|
||||||
|
|
||||||
: (disk-vocabs-recursive) ( root prefix -- seq )
|
: (disk-vocabs-recursive) ( root prefix -- seq )
|
||||||
vocab-directory-entries
|
vocab-directory-entries
|
||||||
[ add-vocab-children% ] { } make
|
[ add-vocab-children% ] { } make ;
|
||||||
[ name>> ] sort-with ;
|
|
||||||
|
|
||||||
: no-rooted ( seq -- seq' ) [ find-vocab-root ] reject ;
|
: no-rooted ( seq -- seq' ) [ find-vocab-root ] reject ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue