Sujet : Re: VALUE and TO implementation
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 07. Aug 2024, 07:11:03
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Aug7.081103@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : xrn 10.11
dxf <
dxforth@gmail.com> writes:
On 6/08/2024 2:27 pm, dxf wrote:
...
ISTR dual-xt solutions also have problems with 'edge cases'.
>
Works for state-smart but not dual-xt:
>
: ," postpone s" dup c, here over allot swap cmove ;
>
," Hello world"
I did not understand at first what this code was supposed to do, in
particular why you would want to perform the compilation semantics of
S" outside a colon definition.
After some thinking I found that this code actually relies on a buggy
implementation of S" which does not implement the compilation
semantics of the standard S" in this usage. It's better to write code
that does not rely on such bugs:
: ," ['] s" execute dup c, here over allot swap cmove ;
," Hello world"
or just
: ," '"' parse dup c, here over allot swap cmove ;
," Hello world"
As for the argument that this is supposed to be a problem of correct
implementations of S": Yes, one can write code that relies on a bug,
for every bug. That does not justify the bug.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.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