Sujet : Re: Back & Forth - 4tH I/O and You
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forthDate : 19. May 2025, 10:55:32
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$275d8c6f$664d1957@ad6fed0bbc602837>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
078ff0e4ae28526fe1c04fef6474326237ad928d@i2pn2.org>,
dxf <
dxforth@gmail.com> wrote:
On 19/05/2025 2:49 am, Hans Bezemer wrote:
...
Second - I've consulted my script, and nowhere do I use the word "redirection". I *do* state, however: "That means I have to *reuse* as many tokens as possible."
>
What I mean is: why should I change my source to:
>
S>D <# #S ROT SIGN #> fid WRITE-FILE
>
When I can continue to use a perfectly capable: .
>
In my case that would be: (.) WRITE
>
where (.) is a kernel function and WRITE is a library function with
appropriate error handling:
>
123 (.) write invalid handle error ... aborting
>
Using that library I could define DISK as mentioned previously and do:
>
DISK 123 . CONSOLE
>
but as any exception msg would go to the file, redirection seems more
trouble than worth.
>
Huh? Redirection is not what you do in your program. It is outside
in the OS. It requires only avoiding silly design choices in
your Forth such as channeling all output through a one character
at a time function as a revectorable EMIT.
If you try to redirect via revectoring EMIT, you have already lost.
Groetjes Albert
-- Temu exploits Christians: (Disclaimer, only 10 apostles)Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style WallArt For Home, Office And Garden Decor - Perfect For Windows, Bars,And Gifts For Friends Family And Colleagues.