X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/a1f4e52df60d8f26327ed57f5a9e7b70d0a04273..8e9db35f299d8f606ba003d3cd8fa9e2c868c880:/fth/wordslik.fth diff --git a/fth/wordslik.fth b/fth/wordslik.fth index ff73c63..e5ebd5a 100644 --- a/fth/wordslik.fth +++ b/fth/wordslik.fth @@ -1,44 +1,44 @@ -\ @(#) wordslik.fth 98/01/26 1.2 -\ -\ WORDS.LIKE ( -- , search for words that contain string ) -\ -\ Enter: WORDS.LIKE + -\ Enter: WORDS.LIKE EMIT -\ -\ Author: Phil Burk -\ Copyright 1994 3DO, Phil Burk, Larry Polansky, Devid Rosenboom -\ -\ The pForth software code is dedicated to the public domain, -\ and any third party may reproduce, distribute and modify -\ the pForth software code or any derivative works thereof -\ without any compensation or license. The pForth software -\ code is provided on an "as is" basis without any warranty -\ of any kind, including, without limitation, the implied -\ warranties of merchantability and fitness for a particular -\ purpose and their equivalents under the laws of any jurisdiction. - -anew task-wordslik.fth -decimal - - -: PARTIAL.MATCH.NAME ( $str1 nfa -- flag , is $str1 in nfa ??? ) - count $ 1F and - rot count - search - >r 2drop r> -; - -: WORDS.LIKE ( -- , print all words containing substring ) - BL word latest - >newline - BEGIN - prevname dup 0<> \ get previous name in dictionary - WHILE - 2dup partial.match.name - IF - dup id. tab - cr? - THEN - REPEAT 2drop - >newline -; +\ @(#) wordslik.fth 98/01/26 1.2 +\ +\ WORDS.LIKE ( -- , search for words that contain string ) +\ +\ Enter: WORDS.LIKE + +\ Enter: WORDS.LIKE EMIT +\ +\ Author: Phil Burk +\ Copyright 1994 3DO, Phil Burk, Larry Polansky, Devid Rosenboom +\ +\ The pForth software code is dedicated to the public domain, +\ and any third party may reproduce, distribute and modify +\ the pForth software code or any derivative works thereof +\ without any compensation or license. The pForth software +\ code is provided on an "as is" basis without any warranty +\ of any kind, including, without limitation, the implied +\ warranties of merchantability and fitness for a particular +\ purpose and their equivalents under the laws of any jurisdiction. + +anew task-wordslik.fth +decimal + + +: PARTIAL.MATCH.NAME ( $str1 nfa -- flag , is $str1 in nfa ??? ) + count $ 1F and + rot count + search + >r 2drop r> +; + +: WORDS.LIKE ( -- , print all words containing substring ) + BL word latest + >newline + BEGIN + prevname dup 0<> \ get previous name in dictionary + WHILE + 2dup partial.match.name + IF + dup id. tab + cr? + THEN + REPEAT 2drop + >newline +;