factor compilation unit from tools.annotations:reset
							parent
							
								
									c0e99e738e
								
							
						
					
					
						commit
						4b8132d777
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
        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" ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue