Fix multiple reload issue

db4
Slava Pestov 2008-02-11 16:44:13 -06:00
parent bacc5dc610
commit d976b11445
1 changed files with 27 additions and 5 deletions

View File

@ -160,13 +160,18 @@ SYMBOL: load-help?
: load-failures. ( failures -- )
[ load-error. nl ] each ;
SYMBOL: blacklist
: require-all ( vocabs -- failures )
[
V{ } clone blacklist set
[
[
[ require ]
[ error-continuation get 3array , ]
recover
[
over vocab-name blacklist get push
error-continuation get 3array ,
] recover
] each
] { } make
] with-compiler-errors ;
@ -182,7 +187,7 @@ SYMBOL: load-help?
: refresh-all ( -- ) "" refresh ;
GENERIC: (load-vocab) ( name -- vocab )
!
M: vocab (load-vocab)
dup vocab-root [
dup vocab-source-loaded? [ dup load-source ] unless
@ -195,8 +200,25 @@ M: string (load-vocab)
M: vocab-link (load-vocab)
vocab-name (load-vocab) ;
[ [ dup vocab [ ] [ ] ?if (load-vocab) ] with-compiler-errors ]
load-vocab-hook set-global
TUPLE: blacklisted-vocab name ;
!
: blacklisted-vocab ( name -- * )
\ blacklisted-vocab construct-boa throw ;
M: blacklisted-vocab error.
"This vocabulary depends on the " write
blacklisted-vocab-name write
" vocabulary which failed to load" print ;
[
dup vocab-name blacklist get member? [
vocab-name blacklisted-vocab
] [
[
dup vocab [ ] [ ] ?if (load-vocab)
] with-compiler-errors
] if
] load-vocab-hook set-global
: vocab-where ( vocab -- loc )
vocab-source-path dup [ 1 2array ] when ;