Re: How robust is INCLUDE

Liste des GroupesRevenir à cl forth 
Sujet : Re: How robust is INCLUDE
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forth
Date : 20. Dec 2024, 10:59:38
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Dec20.105938@mips.complang.tuwien.ac.at>
References : 1
User-Agent : xrn 10.11
mhx@iae.nl (mhx) writes:
I wonder if the following code is (partially) ANS compatible, and
if it is easy to understand what it does, especially the word MAIN3.

There is no definition of MAIN3 in what you posted, only a use, so no.

What I need is a word that is passed parameters that define an index
into an array that is not allotted yet. So neither the index nor the
base address
can be pre-computed.
When the word executes (after much more code which
finally sets up the data), it should access the array to fetch a byte at
the indexed position.

From this description, what's wrong with

: array-c@ ( c-addr uindex -- c ) + c@ ;

?  But I expect that I missed something about your requirements.

In general, if you want a program to be easily understandable, avoid
iForthisms (especially where standard alternatives are
straightforwardly available.  Avoiding LOCALS| is also a good idea.
It's unintuitive and therefore harder-to-understand order of locals
was the reason why {: was standardized.

- 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: https://forth-standard.org/
   EuroForth 2024: https://euro.theforth.net

Date Sujet#  Auteur
19 Dec 24 * How robust is INCLUDE5mhx
20 Dec 24 +- Re: How robust is INCLUDE1Anton Ertl
20 Dec 24 +* Re: How robust is INCLUDE2minforth
20 Dec 24 i`- Re: How robust is INCLUDE1mhx
29 Jan 25 `- Re: How robust is INCLUDE1Ruvim

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal