diff --git a/core/generic/standard/standard-tests.factor b/core/generic/standard/standard-tests.factor index 9cee497d6d..54fc3c8ca3 100644 --- a/core/generic/standard/standard-tests.factor +++ b/core/generic/standard/standard-tests.factor @@ -309,3 +309,11 @@ M: xref-tuple-2 xref-test (xref-test) ; \ xref-test \ xref-tuple-2 \ xref-test method [ usage unique ] closure key? ] unit-test + +[ t ] [ + { } \ nth effective-method nip \ sequence \ nth method eq? +] unit-test + +[ t ] [ + \ + \ nth effective-method nip dup \ nth "default-method" word-prop eq? and +] unit-test diff --git a/core/generic/standard/standard.factor b/core/generic/standard/standard.factor index 89c2a2a396..f8b3c00c31 100644 --- a/core/generic/standard/standard.factor +++ b/core/generic/standard/standard.factor @@ -105,7 +105,9 @@ ERROR: no-next-method class generic ; ] [ ] make ; : single-effective-method ( obj word -- method ) - [ order [ instance? ] with find-last nip ] keep method ; + [ [ order [ instance? ] with find-last nip ] keep method ] + [ "default-method" word-prop ] + bi or ; TUPLE: standard-combination # ; diff --git a/extra/tools/walker/walker-tests.factor b/extra/tools/walker/walker-tests.factor index 2d4a6c3396..7f154a4dbf 100755 --- a/extra/tools/walker/walker-tests.factor +++ b/extra/tools/walker/walker-tests.factor @@ -1,6 +1,7 @@ USING: tools.walker io io.streams.string kernel math math.private namespaces prettyprint sequences tools.test -continuations math.parser threads arrays tools.walker.debug ; +continuations math.parser threads arrays tools.walker.debug +generic.standard ; IN: tools.walker.tests [ { } ] [ @@ -97,6 +98,9 @@ IN: tools.walker.tests [ { 6 } ] [ [ [ 3 throw ] [ 2 * ] recover ] test-walker ] unit-test +[ { T{ no-method f + nth } } ] +[ [ [ 0 \ + nth ] [ ] recover ] test-walker ] unit-test + [ { } ] [ [ "a" "b" set "c" "d" set [ ] test-walker ] with-scope ] unit-test diff --git a/extra/tools/walker/walker.factor b/extra/tools/walker/walker.factor index 07a5759af2..3d7ee035dc 100755 --- a/extra/tools/walker/walker.factor +++ b/extra/tools/walker/walker.factor @@ -83,6 +83,9 @@ M: object add-breakpoint ; : (step-into-continuation) ( -- ) continuation callstack >>call break ; +: (step-into-call-next-method) ( class generic -- ) + next-method-quot (step-into-quot) ; + ! Messages sent to walker thread SYMBOL: step SYMBOL: step-out @@ -132,6 +135,7 @@ SYMBOL: +stopped+ { if [ (step-into-if) ] } { dispatch [ (step-into-dispatch) ] } { continuation [ (step-into-continuation) ] } + { (call-next-method) [ (step-into-call-next-method) ] } } [ "step-into" set-word-prop ] assoc-each {