diff --git a/glossary.forth b/glossary.forth index db6db6d..e5ae426 100755 --- a/glossary.forth +++ b/glossary.forth @@ -16,6 +16,10 @@ not, just exit. sys:argc n:zero? [ #0 unix:exit ] if ~~~ +~~~ +:GLOSSARY-TOOL ; +~~~ + If execution reaches this point there's at least one argument. I use a loop to store arguments into an array named `Args`. @@ -174,6 +178,19 @@ There are five primary roles: 'words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ; ~~~ +## Missing Words + +~~~ +'GlossaryNames d:create #4097 allot + +:populate-names + #1 'words.tsv [ !SourceLine field:name s:keep over &GlossaryNames + store n:inc ] file:for-each-line + n:dec &GlossaryNames store ; +:display-missing + 'GLOSSARY-TOOL d:lookup fetch !Dictionary + populate-names [ d:name dup &GlossaryNames set:contains-string? [ drop ] [ s:put nl ] choose ] d:for-each ; +~~~ + ## Add a Word This just adds a stub to the end of the words.tsv file. @@ -406,6 +423,7 @@ to use. 'add_ s:put nl 'edit__ s:put nl 'export_ s:put nl + 'missing s:put nl #32 [ $- c:put ] times nl 'Editor_Fields: s:put nl '__name\n__dstack\n__astack\n__fstack\n s:format s:put @@ -540,7 +558,8 @@ handle each case. 'edit [ handle-edit ] s:case 'add [ add-word ] s:case 'delete [ delete-entry ] s:case - 'serve [ gopher:serve ] s:case + 'serve [ gopher:serve ] s:case + 'missing [ display-missing ] s:case drop show-help ; ~~~ diff --git a/literate/RetroForth.md b/literate/RetroForth.md index 2c78bf5..7e14b20 100644 --- a/literate/RetroForth.md +++ b/literate/RetroForth.md @@ -1337,7 +1337,7 @@ a flag. [ over eq? @F or !F ] set:for-each drop @F ; - :set:contains-string? (na-f) + :set:contains-string? (sa-f) &F v:off [ over s:eq? @F or !F ] set:for-each drop @F ;