From: Matthias T. <mt...@we...> - 2010-09-18 10:41:30
|
Pito, > Hi, > just as an inspiration - for people who use amforth with student for > education - in the FlashForth there is a nice worh "help" I like > (see ff36). You load the help and helpwords (~few kB) and: > help emit see repository: lib/help.frt and lib/help-words.frt. the later will be automatically generated (later on) \ small online help system \ usage \ help <word> \ prints the stack effects and a short description \ requires words from dict_wl.inc wordlist constant help-wl : help bl word count help-wl search-wordlist if execute then ; mt@ayla:~/projekte/Sourceforge/amforth/trunk/lib$ cat help-words.frt \ requires help \ get-current help-wl set-current : emit ." ( c -- ) " ." R:( -- ) " ." emits a single character on the terminal, calls pause" ; : key ." ( -- c ) " ." R: ( -- ) " ." waits for a key stroke, calls pause " ; set-current it uses a separate wordlist and if it finds a word there, it will be executed. Not to be confused with the standard wordlists. One should never add help-wl to the search-order ;=) Again: great idea Matthias |