factor/library/help/word-help.factor

24 lines
590 B
Factor
Raw Normal View History

! Copyright (C) 2005, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2005-12-30 03:57:38 -05:00
IN: help
2006-03-27 02:34:07 -05:00
USING: arrays kernel namespaces prettyprint sequences words ;
2005-12-30 03:57:38 -05:00
2006-03-27 02:34:07 -05:00
M: word article-title word-name ;
2005-12-30 03:57:38 -05:00
: word-article ( word -- article ) "help" word-prop ;
2006-05-20 17:02:08 -04:00
: word-help ( word -- article )
2005-12-30 03:57:38 -05:00
[
\ $synopsis over 2array ,
2006-05-20 17:02:08 -04:00
dup word-article [
%
] [
"predicating" word-prop [
\ $predicate swap 2array ,
] when*
] ?if
2005-12-30 03:57:38 -05:00
] { } make ;
2006-05-20 17:02:08 -04:00
M: word article-content
dup word-help { $definition } rot add add ;