Links to words in apropos work better

db4
Slava Pestov 2009-02-01 06:33:44 -06:00
parent 92708c7231
commit 00fb6496fb
3 changed files with 7 additions and 3 deletions

View File

@ -147,6 +147,12 @@ ALIAS: $slot $snippet
: $link ( element -- )
first ($link) ;
: ($word-link) ( word -- )
[ name>> ] keep write-link ;
: $word-link ( element -- )
first ($word-link) ;
: ($long-link) ( object -- )
[ article-title ] [ >link ] bi write-link ;

View File

@ -28,8 +28,6 @@ M: more-completions article-name
M: more-completions article-content
seq>> sort-values keys \ $completions prefix ;
M: more-completions summary article-title ;
: (apropos) ( str candidates title -- element )
[
[ completions ] dip '[

View File

@ -160,7 +160,7 @@ C: <vocab-author> vocab-author
: words-table ( words -- )
[
[ <$link> ]
[ 1array \ $word-link prefix ]
[ stack-effect dup [ effect>string <$snippet> ] when ]
bi 2array
] map