Sujet : Re: Operator overloading?
De : mhx (at) *nospam* iae.nl (mhx)
Groupes : comp.lang.forthDate : 31. Jul 2024, 14:15:55
Autres entêtes
Organisation : novaBBS
Message-ID : <1ac5089f1316558b948c89b5ffe8e3d0@www.novabbs.com>
References : 1 2 3 4 5 6
User-Agent : Rocksolid Light
On Wed, 31 Jul 2024 10:31:29 +0000, minforth wrote:
1 value fv
222 to cr
fv
>
looks weird but probably works with a non-parsing TO i.e.
store 222 in fv.
>
TO stores an id as a message in a global variable which is
queried and reset by the next value.
>
It's a bit like in the old message-object vs object-message
discussion. Both have pros and cons.
The behavior makes some code a bit more "readable", e.g.,
when using TO-arrays ( stockprice here):
55e TO (( 5 )) stockprice
However, it could be that the index calculation uses
VALUEs too (very visibly here),
5 value ix
55 (( ix )) stockprice
and then it quickly becomes far less pretty. In FysForth
they let (( and )) stack/unstack the VALUE selector message.
In iForth I have never used (( )) or value arrays and never
missed them.
-marcel