| Deutsch English Français Italiano |
|
<a0acecd6d9e2fd8067bf19c9050b1c15@www.novabbs.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: minforth@gmx.net (minforth)
Newsgroups: comp.lang.forth
Subject: Re: Operator =?UTF-8?B?b3ZlcmxvYWRpbmc/?=
Date: Sat, 27 Jul 2024 12:10:28 +0000
Organization: novaBBS
Message-ID: <a0acecd6d9e2fd8067bf19c9050b1c15@www.novabbs.com>
References: <a1aab44ee3b1b56c2f54f2606e98d040@www.novabbs.com> <pzvvwo76lx5kh.fsf@barkhauseninstitut.org> <698bd09c6db27738ab6a1c3222aba1e1@www.novabbs.com> <2024Jul25.140858@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="535317"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0+ejqm+s29REto3A2x2P4fP+XaUXf51pZgtYBR0nEqI";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$kp0MJUPm2X2rptCLHuFx1uyjqnAxpfW4la/NyX4ADLwyzMVy4iIcO
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: d2a19558f194e2f1f8393b8d9be9ef51734a4da3
Bytes: 1895
Lines: 23
On Thu, 25 Jul 2024 12:08:58 +0000, Anton Ertl wrote:
>>I am thinking on a much smaller scale i.e. unification of
>>operators for xVALUEs and xLOCALs. ANS Forth already has
>>overloaded TO but stops there.
>
> +TO is a common extension.
Certainly. I have some array operations in mind, but they
are not relevant here. The principle is like
: INIT { a }
[[: a ;]] \ read counter
[[: 1 +to a ;]] ; \ increment counter
DEFER count IS count
DEFER read IS read
5 INIT
COUNT COUNT READ -> should give 7
[[: ;]] define closures, but unlike gforth's more flexible
flat closures, they capture simply all upvalues (here local a).
The code compiles unmodified for different types of a.
Incidentally, it compiles now with +TO, but realistically you
can't declare new 'op'TOs for too many different 'op' operators.