Omit default method from usage lists

db4
Slava Pestov 2008-09-01 04:32:26 -05:00
parent 8bf37558d4
commit 3b24b52673
2 changed files with 5 additions and 5 deletions

View File

@ -105,6 +105,10 @@ M: method-body crossref?
drop [ <method> dup ] 2keep reveal-method
] if ;
PREDICATE: default-method < word "default" word-prop ;
M: default-method irrelevant? drop t ;
: <default-method> ( generic combination -- method )
[ drop object bootstrap-word swap <method> ] [ make-default-method ] 2bi
[ define ] [ drop t "default" set-word-prop ] [ drop ] 2tri ;
@ -137,7 +141,7 @@ M: method-body definer
M: method-body forget*
dup "forgotten" word-prop [ drop ] [
[
dup "default" word-prop [ drop ] [
dup default-method? [ drop ] [
[
[ "method-class" word-prop ]
[ "method-generic" word-prop ] bi

View File

@ -26,10 +26,6 @@ ERROR: no-method object generic ;
: error-method ( word -- quot )
picker swap [ no-method ] curry append ;
: default-method ( word -- pair )
"default-method" word-prop
object bootstrap-word swap 2array ;
: push-method ( method specializer atomic assoc -- )
[
[ H{ } clone <predicate-dispatch-engine> ] unless*