Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #59603

Most recent WORDS last

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Most recent WORDS last
Date 2017-05-20 16:47 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2017May20.184757@mips.complang.tuwien.ac.at> (permalink)

Show all headers | View raw


There have been occasional complaints about Gforth's WORDS showing the
oldest words last (and the most recent words scrolled off the screen).
With TRAVERSE-WORDLIST, you can do something about it yourself:

For a completely standard (Forth-2012) definition, use

: sdrow ( -- )
    0 ['] true context @ traverse-wordlist begin
	dup while
	    name>string type space repeat
    drop ;

If you don't want words broken across line endings, the
Gforth-specific .WORD ( n1 nt -- n2 ) prevents that.

: sdrow ( -- )
    0 ['] true context @ traverse-wordlist 0 begin
	over while
	    swap .word repeat
    2drop ;

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2017: http://www.euroforth.org/ef17/

Back to comp.lang.forth | Previous | Next | Find similar | Unroll thread


Thread

Most recent WORDS last anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 16:47 +0000

csiph-web