Slava Pestov 2008-10-01 08:38:50 -05:00
parent 34952ff5c4
commit e1a2bfc048
2 changed files with 16 additions and 2 deletions

View File

@ -222,3 +222,17 @@ M: integer a-generic a-word ;
M: boii jeah ;
"> eval
] unit-test
! call-next-method cache test
GENERIC: c-n-m-cache ( a -- b )
! Force it to be unoptimized
M: fixnum c-n-m-cache { } [ ] like call call-next-method ;
M: integer c-n-m-cache 1 + ;
M: number c-n-m-cache ;
[ 3 ] [ 2 c-n-m-cache ] unit-test
[ ] [ [ { integer c-n-m-cache } forget ] with-compilation-unit ] unit-test
[ 2 ] [ 2 c-n-m-cache ] unit-test

View File

@ -152,8 +152,8 @@ M: method-body forget*
] keep eq?
[
[ [ delete-at ] with-methods ]
[ [ delete-at ] with-implementors ]
2bi
[ [ delete-at ] with-implementors ] 2bi
reset-caches
] [ 2drop ] if
] if
]