From 849b6d76f4a1e4cd893887e2afcc1742581c912c Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 5 Feb 2018 15:40:46 -0800 Subject: [PATCH] fuel.help: change find-word to use words-named. It still returns the "first" word found (which might be dubious), but now it supports qualified search like "math:+" find-word. --- extra/fuel/help/help.factor | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extra/fuel/help/help.factor b/extra/fuel/help/help.factor index 48500f5777..0e6428c445 100644 --- a/extra/fuel/help/help.factor +++ b/extra/fuel/help/help.factor @@ -1,10 +1,11 @@ ! Copyright (C) 2009 Jose Antonio Ortega Ruiz. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs combinators combinators.short-circuit -fry help help.crossref help.markup help.markup.private help.topics -help.vocabs io io.streams.string kernel make namespaces parser -prettyprint see sequences splitting summary vocabs vocabs.hierarchy -vocabs.metadata vocabs.parser words ; +USING: accessors arrays assocs combinators +combinators.short-circuit help help.crossref help.markup +help.markup.private help.topics help.vocabs io io.streams.string +kernel make namespaces parser prettyprint see sequences +splitting summary vocabs vocabs.hierarchy vocabs.metadata +vocabs.parser words ; IN: fuel.help SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ; @@ -35,7 +36,7 @@ SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ; > _ = ] all-words swap find nip ] } 1|| ; + { [ search ] [ words-named ?first ] } 1|| ; : definition-str ( word -- str ) [ see ] with-string-writer ; inline