issue #358: Make a word lookup-article so that article is just a tuple.

db4
Doug Coleman 2012-06-20 22:33:47 -07:00
parent eccf5a82ae
commit 2b35edb595
7 changed files with 10 additions and 10 deletions

View File

@ -9,9 +9,9 @@ IN: help.definitions
M: link definer drop \ ARTICLE: \ ; ; M: link definer drop \ ARTICLE: \ ; ;
M: link where name>> article loc>> ; M: link where name>> lookup-article loc>> ;
M: link set-where name>> article loc<< ; M: link set-where name>> lookup-article loc<< ;
M: link forget* name>> remove-article ; M: link forget* name>> remove-article ;

View File

@ -131,7 +131,7 @@ ARTICLE: "help-impl" "Help system implementation"
} }
"Help article implementation:" "Help article implementation:"
{ $subsections { $subsections
article lookup-article
articles articles
} }
"Links:" "Links:"

View File

@ -68,7 +68,7 @@ PRIVATE>
: check-about ( vocab -- ) : check-about ( vocab -- )
vocab-link boa dup vocab-link boa dup
'[ _ vocab-help [ article drop ] when* ] check-something ; '[ _ vocab-help [ lookup-article drop ] when* ] check-something ;
: check-vocab ( vocab -- ) : check-vocab ( vocab -- )
"Checking " write dup write "..." print flush "Checking " write dup write "..." print flush

View File

@ -10,7 +10,7 @@ HELP: no-article
{ $description "Throws a " { $link no-article } " error." } { $description "Throws a " { $link no-article } " error." }
{ $error-description "Thrown by " { $link help } " if the given help topic does not exist, or if the help topic being displayed links to a help topic which does not exist." } ; { $error-description "Thrown by " { $link help } " if the given help topic does not exist, or if the help topic being displayed links to a help topic which does not exist." } ;
HELP: article HELP: lookup-article
{ $values { "name" "an article name" } { "article" "an " { $link article } " object" } } { $values { "name" "an article name" } { "article" "an " { $link article } " object" } }
{ $description "Outputs a named " { $link article } " object." } ; { $description "Outputs a named " { $link article } " object." } ;

View File

@ -61,12 +61,12 @@ ERROR: no-article name ;
M: no-article summary M: no-article summary
drop "Help article does not exist" ; drop "Help article does not exist" ;
: article ( name -- article ) : lookup-article ( name -- article )
articles get ?at [ no-article ] unless ; articles get ?at [ no-article ] unless ;
M: object valid-article? articles get key? ; M: object valid-article? articles get key? ;
M: object article-title article article-title ; M: object article-title lookup-article article-title ;
M: object article-content article article-content ; M: object article-content lookup-article article-content ;
M: object article-parent article-xref get at ; M: object article-parent article-xref get at ;
M: object set-article-parent article-xref get set-at ; M: object set-article-parent article-xref get set-at ;

View File

@ -107,7 +107,7 @@ PRIVATE>
! Help support ! Help support
: fuel-get-article ( name -- ) article fuel-eval-set-result ; : fuel-get-article ( name -- ) lookup-article fuel-eval-set-result ;
: fuel-get-article-title ( name -- ) : fuel-get-article-title ( name -- )
articles get at [ article-title ] [ f ] if* fuel-eval-set-result ; articles get at [ article-title ] [ f ] if* fuel-eval-set-result ;

View File

@ -62,7 +62,7 @@ PRIVATE>
: doc-location ( word -- loc ) props>> "help-loc" swap at get-loc ; : doc-location ( word -- loc ) props>> "help-loc" swap at get-loc ;
: article-location ( name -- loc ) article loc>> get-loc ; : article-location ( name -- loc ) lookup-article loc>> get-loc ;
: get-vocabs ( -- seq ) all-vocab-names ; : get-vocabs ( -- seq ) all-vocab-names ;