[ { hey } ] [ alpha protocol-users ] unit-test
[ { hey } ] [ beta protocol-users ] unit-test
[ ] [ "USE: delegate IN: delegate.tests PROTOCOL: alpha one ;" eval( -- ) ] unit-test
-[ f ] [ hey \ two method ] unit-test
-[ f ] [ hey \ four method ] unit-test
+[ f ] [ hey \ two ?lookup-method ] unit-test
+[ f ] [ hey \ four ?lookup-method ] unit-test
[ ] [ "USE: delegate IN: delegate.tests PROTOCOL: beta two three four ;" eval( -- ) ] unit-test
[ { hey } ] [ alpha protocol-users ] unit-test
[ { hey } ] [ beta protocol-users ] unit-test
[ -1 ] [ 1 <hey> three ] unit-test
[ -1 ] [ 1 <hey> four ] unit-test
[ ] [ "IN: delegate.tests FORGET: alpha" eval( -- ) ] unit-test
-[ f ] [ hey \ one method ] unit-test
+[ f ] [ hey \ one ?lookup-method ] unit-test
TUPLE: slot-protocol-test-1 a b ;
TUPLE: slot-protocol-test-2 < slot-protocol-test-1 { c integer } ;
DEFER: slot-protocol-test-3
SLOT: y
-[ f ] [ \ slot-protocol-test-3 \ y>> method >boolean ] unit-test
+[ f ] [ \ slot-protocol-test-3 \ y>> ?lookup-method >boolean ] unit-test
[ [ ] ] [
"IN: delegate.tests
<string-reader> "delegate-test-1" parse-stream
] unit-test
-[ t ] [ \ slot-protocol-test-3 \ y>> method >boolean ] unit-test
+[ t ] [ \ slot-protocol-test-3 \ y>> ?lookup-method >boolean ] unit-test
[ [ ] ] [
"IN: delegate.tests
! We now have a real accessor for the y slot; we don't want it to
! get lost
-[ t ] [ \ slot-protocol-test-3 \ y>> method >boolean ] unit-test
+[ t ] [ \ slot-protocol-test-3 \ y>> ?lookup-method >boolean ] unit-test
! We want to be able to override methods after consultation
[ [ ] ] [
\ protocol-consult word-prop delete-at ;
: unconsult-method ( word consultation -- )
- [ class>> swap first lookup-method ] keep
+ [ class>> swap first ?lookup-method ] keep
over [
over "consultation" word-prop eq?
[ forget ] [ drop ] if
<PRIVATE
: forget-all-methods ( classes words -- )
- [ first lookup-method forget ] cartesian-each ;
+ [ first ?lookup-method forget ] cartesian-each ;
: protocol-users ( protocol -- users )
protocol-consult keys ;