{ $values { "word" word } { "members" "a sequence of class words" } { "superclass" class } { "metaclass" class } }
{ $description "Sets a property indicating this word is a class word, thus making it an instance of " { $link class } ", and registers it with " { $link typemap } " and " { $link class<map } "." }
$low-level-note ;
-
-: $predicate ( element -- )
- { { "object" object } { "?" "a boolean" } } $values
- [
- "Tests if the object is an instance of the " ,
- first "predicating" word-prop \ $link swap 2array ,
- " class." ,
- ] { } make $description ;
-
-M: predicate word-help* drop \ $predicate ;
-
-HELP: $predicate
-{ $values { "element" "a markup element of the form " { $snippet "{ word }" } } }
-{ $description "Prints the boilerplate description of a class membership predicate word such as " { $link array? } " or " { $link integer? } "." } ;
USING: help.markup help.crossref help.topics help.syntax
-definitions io prettyprint inspector help.lint ;
+definitions io prettyprint inspector help.lint arrays math ;
IN: help
ARTICLE: "printing-elements" "Printing markup elements"
{ $description "Sorts a sequence of help topics." } ;
{ article-children article-parent xref-help } related-words
+
+HELP: $predicate
+{ $values { "element" "a markup element of the form " { $snippet "{ word }" } } }
+{ $description "Prints the boilerplate description of a class membership predicate word such as " { $link array? } " or " { $link integer? } "." } ;
words assocs definitions generic quotations effects
slots continuations tuples debugger combinators
vocabs help.stylesheet help.topics help.crossref help.markup
-sorting ;
+sorting classes ;
IN: help
GENERIC: word-help* ( word -- content )
[ swap 2array 1array ] [ 2drop f ] if
] ?if ;
+: $predicate ( element -- )
+ { { "object" object } { "?" "a boolean" } } $values
+ [
+ "Tests if the object is an instance of the " ,
+ first "predicating" word-prop \ $link swap 2array ,
+ " class." ,
+ ] { } make $description ;
+
M: word word-help* drop f ;
M: slot-reader word-help* drop \ $slot-reader ;
M: slot-writer word-help* drop \ $slot-writer ;
+M: predicate word-help* drop \ $predicate ;
+
: all-articles ( -- seq )
articles get keys
all-words [ word-help ] subset append ;