factor compilation unit from tools.annotations:reset

db4
Joe Groff 2009-07-14 11:43:32 -05:00
parent c0e99e738e
commit 4b8132d777
1 changed files with 12 additions and 7 deletions

View File

@ -7,19 +7,24 @@ tools.time generic inspector fry tools.continuations
locals generalizations macros ;
IN: tools.annotations
GENERIC: reset ( word -- )
<PRIVATE
M: generic reset
subwords [ reset ] each ;
GENERIC: (reset) ( word -- )
M: word reset
M: generic (reset)
subwords [ (reset) ] each ;
M: word (reset)
dup "unannotated-def" word-prop [
[
dup dup "unannotated-def" word-prop define
] with-compilation-unit
dup dup "unannotated-def" word-prop define
f "unannotated-def" set-word-prop
] [ drop ] if ;
PRIVATE>
: reset ( word -- )
[ (reset) ] with-compilation-unit ;
ERROR: cannot-annotate-twice word ;
M: cannot-annotate-twice summary drop "Cannot annotate a word twice" ;