definitions: make FORGET: M\ update compiled xref correctly
parent
64a7fd0a4d
commit
eb6933ebfc
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue