diff --git a/basis/delegate/delegate-docs.factor b/basis/delegate/delegate-docs.factor index 5a2f4802e9..9456941880 100644 --- a/basis/delegate/delegate-docs.factor +++ b/basis/delegate/delegate-docs.factor @@ -1,4 +1,4 @@ -USING: help.syntax help.markup ; +USING: help.syntax help.markup delegate.private ; IN: delegate HELP: define-protocol @@ -8,7 +8,7 @@ HELP: define-protocol HELP: PROTOCOL: { $syntax "PROTOCOL: protocol-name words... ;" } -{ $description "Defines an explicit protocol, which can be used as a basis for delegation or mimicry." } ; +{ $description "Defines an explicit protocol, which can be used as a basis for delegation." } ; { define-protocol POSTPONE: PROTOCOL: } related-words @@ -22,6 +22,12 @@ HELP: CONSULT: { $values { "group" "a protocol, generic word or tuple class" } { "class" "a class" } { "getter" "code to get where the method should be forwarded" } } { $description "Defines a class to consult, using the given code, on the generic words contained in the group. This means that, when one of the words in the group is called on an object of this class, the quotation will be called, and then the generic word called again. If the getter is empty, this will cause an infinite loop. Consultation overwrites the existing methods, but others can be defined afterwards." } ; +HELP: SLOT-PROTOCOL: +{ $syntax "SLOT-PROTOCOL: protocol-name slots... ;" } +{ $description "Defines a protocol consisting of reader and writer words for the listen slot names." } ; + +{ define-protocol POSTPONE: PROTOCOL: } related-words + { define-consult POSTPONE: CONSULT: } related-words HELP: group-words @@ -40,6 +46,8 @@ $nl "Defining new protocols:" { $subsection POSTPONE: PROTOCOL: } { $subsection define-protocol } +"Defining new protocols consisting of slot accessors:" +{ $subsection POSTPONE: SLOT-PROTOCOL: } "Defining consultation:" { $subsection POSTPONE: CONSULT: } { $subsection define-consult } diff --git a/basis/delegate/tags.txt b/basis/delegate/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/delegate/tags.txt @@ -0,0 +1 @@ +extensions