From 7780f9a3dd0965bb1324306a2a193c90ba73aaff Mon Sep 17 00:00:00 2001 From: crc <> Date: Mon, 11 Dec 2023 23:39:47 +0000 Subject: [PATCH] add new example w/colored d:words; `describe` added to library/ FossilOrigin-Name: f921df78f23ff7a699fd63595601a340e1b618af5f06d69548aef40e10ed507d --- CURRENT.txt | 2 -- RELEASE-NOTES | 3 ++- example/colored-dwords.retro | 19 +++++++++++++++++++ library/describe.retro | 7 +++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 example/colored-dwords.retro create mode 100644 library/describe.retro diff --git a/CURRENT.txt b/CURRENT.txt index 4468a4e..fdc22a9 100644 --- a/CURRENT.txt +++ b/CURRENT.txt @@ -1,6 +1,4 @@ Currently Active: -- Porting Konilo's (termina) words -- Completing port of Konilo's block editor - Adding missing source data for existing vocabularies - Improving the D implementation of Nga diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7bf5336..592e432 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -56,6 +56,7 @@ the device handlers - support loading extensions at runtime via `library:load` (searches ./library/ and ~/.config/retroforth/library/) -- library contents: block-editor termina x11 +- library contents: block-editor describe termina x11 +- new example: colored-dwords.retro ================================================================ diff --git a/example/colored-dwords.retro b/example/colored-dwords.retro new file mode 100644 index 0000000..eb9679d --- /dev/null +++ b/example/colored-dwords.retro @@ -0,0 +1,19 @@ +This show use of the termina color words to display the contents +of the dictionary, using colors for various word classes. + +~~~ +'termina library:load + +:d:words/c + [ dup d:class fetch + [ &class:data [ fg:magenta ] case + &class:macro [ fg:red ] case + &class:primitive [ fg:yellow ] case + drop fg:green + ] call d:name s:put sp vt:reset ] d:for-each ; +~~~ + + +``` +d:words/c +``` diff --git a/library/describe.retro b/library/describe.retro new file mode 100644 index 0000000..396b5b1 --- /dev/null +++ b/library/describe.retro @@ -0,0 +1,7 @@ +This adds a `describe` word which runs retro-describe(1). It's +a useful tool for looking up glossay data in an interactive +session. + +~~~ +:describe (s-) 'retro-describe_%s s:format unix:system ; +~~~