Deutsch   English   Français   Italiano  
<2024Aug7.081103@mips.complang.tuwien.ac.at>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: VALUE and TO implementation
Date: Wed, 07 Aug 2024 06:11:03 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 40
Message-ID: <2024Aug7.081103@mips.complang.tuwien.ac.at>
References: <a1aab44ee3b1b56c2f54f2606e98d040@www.novabbs.com> <v8in5k$2pq99$1@dont-email.me> <ecc2ee176b98033763c1fb2143cb9935@www.novabbs.com> <v8ler0$3fja7$1@dont-email.me> <4b8297b5787264614edcb6180ef3e1b6@www.novabbs.com> <v8mea6$3fja7$2@dont-email.me> <23a44aa0445a30c0fc782819f48463f9@www.novabbs.com> <66b0c4f2@news.ausics.net> <5eff99125b18466c3fdcd2a0cca8368b@www.novabbs.com> <66b0eabb$1@news.ausics.net> <v8qter$pikr$1@dont-email.me> <66b1a624@news.ausics.net> <66b2e541$1@news.ausics.net>
Injection-Date: Wed, 07 Aug 2024 08:29:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ddc8e0ea52997f6648757db5a6f43050";
	logging-data="2374509"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+ytp+w4fwSOjf/sc4Ld4yL"
Cancel-Lock: sha1:T2uUV2GVUJyLX3/B4AD0LVhGBCY=
X-newsreader: xrn 10.11
Bytes: 2604

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.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