Omit default method from usage lists
parent
8bf37558d4
commit
3b24b52673
|
@ -105,6 +105,10 @@ M: method-body crossref?
|
||||||
drop [ <method> dup ] 2keep reveal-method
|
drop [ <method> dup ] 2keep reveal-method
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
|
PREDICATE: default-method < word "default" word-prop ;
|
||||||
|
|
||||||
|
M: default-method irrelevant? drop t ;
|
||||||
|
|
||||||
: <default-method> ( generic combination -- method )
|
: <default-method> ( generic combination -- method )
|
||||||
[ drop object bootstrap-word swap <method> ] [ make-default-method ] 2bi
|
[ drop object bootstrap-word swap <method> ] [ make-default-method ] 2bi
|
||||||
[ define ] [ drop t "default" set-word-prop ] [ drop ] 2tri ;
|
[ define ] [ drop t "default" set-word-prop ] [ drop ] 2tri ;
|
||||||
|
@ -137,7 +141,7 @@ 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 [ drop ] [
|
dup default-method? [ drop ] [
|
||||||
[
|
[
|
||||||
[ "method-class" word-prop ]
|
[ "method-class" word-prop ]
|
||||||
[ "method-generic" word-prop ] bi
|
[ "method-generic" word-prop ] bi
|
||||||
|
|
|
@ -26,10 +26,6 @@ ERROR: no-method object generic ;
|
||||||
: error-method ( word -- quot )
|
: error-method ( word -- quot )
|
||||||
picker swap [ no-method ] curry append ;
|
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 -- )
|
: push-method ( method specializer atomic assoc -- )
|
||||||
[
|
[
|
||||||
[ H{ } clone <predicate-dispatch-engine> ] unless*
|
[ H{ } clone <predicate-dispatch-engine> ] unless*
|
||||||
|
|
Loading…
Reference in New Issue