vocabs.refresh: slight cleanup.
parent
4788bfba4c
commit
07d92b48e1
|
@ -4,6 +4,6 @@ USING: vocabs.refresh tools.test continuations namespaces ;
|
||||||
{ } [
|
{ } [
|
||||||
changed-vocabs get-global
|
changed-vocabs get-global
|
||||||
f changed-vocabs set-global
|
f changed-vocabs set-global
|
||||||
[ t ] [ "kernel" changed-vocab-by-name? ] unit-test
|
{ t } [ "kernel" changed-vocab? ] unit-test
|
||||||
[ "kernel" changed-vocab ] [ changed-vocabs set-global ] [ ] cleanup
|
[ "kernel" changed-vocab ] [ changed-vocabs set-global ] [ ] cleanup
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -20,7 +20,7 @@ IN: vocabs.refresh
|
||||||
|
|
||||||
SYMBOL: changed-vocabs
|
SYMBOL: changed-vocabs
|
||||||
|
|
||||||
: changed-vocab ( vocab -- )
|
: changed-vocab ( vocab-name -- )
|
||||||
dup lookup-vocab changed-vocabs get and
|
dup lookup-vocab changed-vocabs get and
|
||||||
[ changed-vocabs get adjoin ] [ drop ] if ;
|
[ changed-vocabs get adjoin ] [ drop ] if ;
|
||||||
|
|
||||||
|
@ -30,13 +30,13 @@ SYMBOL: changed-vocabs
|
||||||
: mark-unchanged-vocabs ( vocab-names -- )
|
: mark-unchanged-vocabs ( vocab-names -- )
|
||||||
[ mark-unchanged-vocab ] each ;
|
[ mark-unchanged-vocab ] each ;
|
||||||
|
|
||||||
: changed-vocab-by-name? ( vocab -- ? )
|
: changed-vocab? ( vocab-name -- ? )
|
||||||
changed-vocabs get [ in? ] [ drop t ] if* ;
|
changed-vocabs get [ in? ] [ drop t ] if* ;
|
||||||
|
|
||||||
: (to-refresh) ( vocab-name loaded? path -- ? )
|
: (to-refresh) ( vocab-name loaded? path -- ? )
|
||||||
[
|
[
|
||||||
swap [
|
swap [
|
||||||
swap changed-vocab-by-name? [
|
swap changed-vocab? [
|
||||||
source-modified?
|
source-modified?
|
||||||
] [ drop f ] if
|
] [ drop f ] if
|
||||||
] [ 2drop t ] if
|
] [ 2drop t ] if
|
||||||
|
@ -66,8 +66,7 @@ SYMBOL: changed-vocabs
|
||||||
[
|
[
|
||||||
[ [ lookup-vocab f >>source-loaded? drop ] each ]
|
[ [ lookup-vocab f >>source-loaded? drop ] each ]
|
||||||
[ [ lookup-vocab f >>docs-loaded? drop ] each ] bi*
|
[ [ lookup-vocab f >>docs-loaded? drop ] each ] bi*
|
||||||
]
|
] [
|
||||||
[
|
|
||||||
union
|
union
|
||||||
[ mark-unchanged-vocabs ]
|
[ mark-unchanged-vocabs ]
|
||||||
[ require-all ] bi
|
[ require-all ] bi
|
||||||
|
|
Loading…
Reference in New Issue