That too. Every new forth I tried I would dump its words to keep
as a sorted quick reference.
I actually don't understand, why no Forth creator inserts
into his design WORDS, that allow to examine what's actually
„inside”. Perhaps the worst example is FPC Forth — 1500 words
making just „zooooooooooom!” throught the screen, like a thunder,
when one types WORDS.
It doesn't seem to be that difficult to create „paged” WORDS; here's
my simple take (it's fig-Forth):
: WORDS ( -- )
0 OUT C! 22 OUT 1+ C! CR
CONTEXT @ @
BEGIN
DUP ID. SPACE PFA LFA @ DUP 0=
OUT C@ C/L >
IF CR 0 OUT C! OUT 1+ DUP C@ 1- SWAP C! THEN
OUT 1+ C@ 0= DUP
IF DROP 22 OUT 1+ C! ." >>> ENTER to continue -- any other key to end <<<"
CR KEY 13 = 0= 0 OUT C! THEN ( OUT-lo "reset" because of the message )
OR
UNTIL DROP ;
(yes, a few „magic numbers”, but no big deal; 22 is the lines' count)
--
Z.
It's still not paged, unfortunately. What if I want to browse
the „initial” words? In Linux' environment I can use scrollback
buffer (but not always! Kudos to Mark Manning for implementing
his WORDS as „paged”) fortunately — but in MS-DOS (or similar)
there's a problem. The simple solution is: just to split WORDS'
output into separate pages. In such situation the „old” usual
list order is even better: you'll find your words immediately,
without a need to get to the last screen
--
Z.
[...]
possibly because a better way to do it would be to decouple the source
of the character stream (ie WORDS), and the paging mechanism, so that
the latter could be used for any input stream. In a similar way to how
in Unix/Linux you can 'pipe' a stream to 'more' to get paged output.
(I would hope that at least some Forths work like this, but I confess
I have no idea if this is true)
\ Portable Forth Environment 0.33.73w (Aug 21 2021 09:34:46)...
Copyright (C) Dirk Uwe Zoller 1993 - 1995.
Copyright (C) Tektronix, Inc. 1998 - 2003.
Copyright (C) Guido U. Draheim 2005 - 2008.
ANS/ffa ITC Forth - Please enter LICENSE and WARRANTY.
Running on x86_64 darwin20.6.0 - to quit say BYE. ok
words
C K-SHIFT-MASK p EKEY>FKEY C K-SHIFT-F10
C K-SHIFT-F9 C K-SHIFT-F8 C K-SHIFT-F7
C K-SHIFT-F6 C K-SHIFT-F5 C K-SHIFT-F4
C K-SHIFT-F3 C K-SHIFT-F2 C K-SHIFT-F1
...
p EXITCODE p ARGV p ARGC
p APPLICATION p EDIT-BLOCKFILE p HELP
p STANDARD-I/O p (TYPE) p (KEY)
p (EXPECT) p (EMIT) p *TYPE*
p *KEY* p *EXPECT* p *EMIT*
I don't remember the significance of the C and p
prefixes
It doesn't seem to be that difficult to create "paged" WORDS
On 25/12/2023 2:25 am, Anton Ertl wrote:
zbigniew2011@gmail.com (LIT) writes:
It doesn't seem to be that difficult to create "paged" WORDS
In Gforth, if you want the output of words to be paged, you
require more.fs
I find it cool that this can be added in a Forth system without having
to change every word that outputs multiple lines.
...
That would get very annoying, very quickly - no? Paging poses a similar >problem in that the user is required to enter a key to progress.
"David N. Williams" <williams@umich.edu> writes:
\ Portable Forth Environment 0.33.73w (Aug 21 2021 09:34:46)...
Copyright (C) Dirk Uwe Zoller 1993 - 1995.
Copyright (C) Tektronix, Inc. 1998 - 2003.
Copyright (C) Guido U. Draheim 2005 - 2008.
ANS/ffa ITC Forth - Please enter LICENSE and WARRANTY.
Running on x86_64 darwin20.6.0 - to quit say BYE. ok
words
C K-SHIFT-MASK p EKEY>FKEY C K-SHIFT-F10
C K-SHIFT-F9 C K-SHIFT-F8 C K-SHIFT-F7
C K-SHIFT-F6 C K-SHIFT-F5 C K-SHIFT-F4
C K-SHIFT-F3 C K-SHIFT-F2 C K-SHIFT-F1
...
p EXITCODE p ARGV p ARGC
p APPLICATION p EDIT-BLOCKFILE p HELP
p STANDARD-I/O p (TYPE) p (KEY)
p (EXPECT) p (EMIT) p *TYPE*
p *KEY* p *EXPECT* p *EMIT*
I don't remember the significance of the C and p
prefixes
Looking at these words, my guess is:
C: constant
p: primitive
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 56:05:46 |
Calls: | 6,712 |
Files: | 12,243 |
Messages: | 5,355,474 |