help: move predicate default word help.

locals-and-roots
John Benediktsson 2016-05-26 17:35:37 -07:00
parent fba27d66e4
commit 773edb680a
1 changed files with 10 additions and 19 deletions

View File

@ -23,6 +23,15 @@ M: word default-word-help
] { } map>assoc
] bi@ append members \ $values prefix 1array ;
M: predicate default-word-help
{ $values { "object" object } { "?" boolean } }
[
\ $description ,
"Tests if the object is an instance of the " ,
swap "predicating" word-prop <$link> ,
" class." ,
] { } make 2array ;
M: class default-word-help drop f ;
PRIVATE>
@ -30,25 +39,7 @@ PRIVATE>
GENERIC: word-help* ( word -- content )
: word-help ( word -- content )
dup "help" word-prop [ ] [
dup word-help* [
swap 2array 1array
] [
default-word-help
] if*
] ?if ;
: $predicate ( element -- )
{ { "object" object } { "?" boolean } } $values
[
"Tests if the object is an instance of the " ,
first "predicating" word-prop <$link> ,
" class." ,
] { } make $description ;
M: word word-help* drop f ;
M: predicate word-help* drop \ $predicate ;
dup "help" word-prop [ ] [ default-word-help ] ?if ;
: all-articles ( -- seq )
articles get keys