definitions: make FORGET: M\ update compiled xref correctly

db4
Slava Pestov 2009-09-28 03:04:53 -05:00
parent 64a7fd0a4d
commit eb6933ebfc
2 changed files with 20 additions and 5 deletions

View File

@ -39,10 +39,6 @@ GENERIC: set-where ( loc defspec -- )
GENERIC: forget* ( defspec -- )
M: f forget* drop ;
M: wrapper forget* wrapped>> forget* ;
SYMBOL: forgotten-definitions
: forgotten-definition ( defspec -- )
@ -50,6 +46,10 @@ SYMBOL: forgotten-definitions
: forget ( defspec -- ) [ forgotten-definition ] [ forget* ] bi ;
M: f forget* drop ;
M: wrapper forget* wrapped>> forget ;
: forget-all ( definitions -- ) [ forget ] each ;
GENERIC: definer ( defspec -- start end )

View File

@ -3,7 +3,7 @@ classes.tuple classes.union compiler.units continuations
definitions eval generic generic.math generic.standard
hashtables io io.streams.string kernel layouts math math.order
namespaces parser prettyprint quotations sequences sorting
strings tools.test vectors words ;
strings tools.test vectors words generic.single ;
IN: generic.tests
GENERIC: foobar ( x -- y )
@ -197,3 +197,18 @@ M: slice foozul ;
real \ <=> method
eq?
] unit-test
! FORGET: on method wrappers
GENERIC: forget-test ( a -- b )
M: integer forget-test 3 + ;
[ ] [ "IN: generic.tests USE: math FORGET: M\\ integer forget-test" eval( -- ) ] unit-test
[ { } ] [
\ + compiled-usage keys
[ method-body? ] filter
[ "method-generic" word-prop \ forget-test eq? ] filter
] unit-test
[ 10 forget-test ] [ no-method? ] must-fail-with