Fix more redefinition problems
parent
31ff6e93bb
commit
c1509d5fe5
|
@ -131,6 +131,14 @@ GENERIC: update-methods ( class seq -- )
|
||||||
[ drop update-map+ ]
|
[ drop update-map+ ]
|
||||||
2tri ;
|
2tri ;
|
||||||
|
|
||||||
|
: forget-predicate ( class -- )
|
||||||
|
dup "predicate" word-prop
|
||||||
|
dup length 1 = [
|
||||||
|
first
|
||||||
|
tuck "predicating" word-prop =
|
||||||
|
[ forget ] [ drop ] if
|
||||||
|
] [ 2drop ] if ;
|
||||||
|
|
||||||
GENERIC: class ( object -- class )
|
GENERIC: class ( object -- class )
|
||||||
|
|
||||||
: instance? ( obj class -- ? )
|
: instance? ( obj class -- ? )
|
||||||
|
|
|
@ -136,17 +136,16 @@ M: method-body definer
|
||||||
M: method-body forget*
|
M: method-body forget*
|
||||||
dup "forgotten" word-prop [ drop ] [
|
dup "forgotten" word-prop [ drop ] [
|
||||||
[
|
[
|
||||||
dup "default" word-prop [ call-next-method ] [
|
dup "default" word-prop [ drop ] [
|
||||||
dup
|
[
|
||||||
[ "method-class" word-prop ]
|
[ "method-class" word-prop ]
|
||||||
[ "method-generic" word-prop ] bi
|
[ "method-generic" word-prop ] bi
|
||||||
3dup method eq? [
|
2dup method
|
||||||
[ delete-at ] with-methods
|
] keep eq?
|
||||||
call-next-method
|
[ [ delete-at ] with-methods ] [ 2drop ] if
|
||||||
] [ 3drop ] if
|
|
||||||
] if
|
] if
|
||||||
]
|
]
|
||||||
[ t "forgotten" set-word-prop ] bi
|
[ call-next-method ] bi
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
M: method-body smart-usage
|
M: method-body smart-usage
|
||||||
|
@ -169,7 +168,7 @@ M: sequence implementors
|
||||||
: forget-class ( class -- )
|
: forget-class ( class -- )
|
||||||
class-usages [
|
class-usages [
|
||||||
{
|
{
|
||||||
[ "predicate" word-prop [ forget ] each ]
|
[ forget-predicate ]
|
||||||
[ forget-methods ]
|
[ forget-methods ]
|
||||||
[ update-map- ]
|
[ update-map- ]
|
||||||
[ reset-class ]
|
[ reset-class ]
|
||||||
|
|
Loading…
Reference in New Issue