Deutsch   English   Français   Italiano  
<d0bd3f71dd597bd60bd68f2967378921@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: value-flavoured structures
Date: Fri, 27 Sep 2024 08:51:05 +0000
Organization: novaBBS
Message-ID: <d0bd3f71dd597bd60bd68f2967378921@www.novabbs.com>
References: <nnd$61e0ad9a$48ed61c2@b4d945e456041481> <2024Sep13.200734@mips.complang.tuwien.ac.at> <66e4f98b$1@news.ausics.net> <2024Sep14.081952@mips.complang.tuwien.ac.at> <vc6t1b$27sna$1@dont-email.me> <2024Sep15.181634@mips.complang.tuwien.ac.at> <vd5pjl$kdp4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
	logging-data="3690217"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="0+ejqm+s29REto3A2x2P4fP+XaUXf51pZgtYBR0nEqI";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$Ko0WcyOTX5wZ8HeKJTcXn.9suzkCy049.TResV91.0/nCyZZMOCre
X-Rslight-Posting-User: d2a19558f194e2f1f8393b8d9be9ef51734a4da3
X-Spam-Checker-Version: SpamAssassin 4.0.0
Bytes: 1958
Lines: 15

On Fri, 27 Sep 2024 8:15:48 +0000, Ruvim wrote:
> For example, it's impossible to change n to d, n to r, or vice versa,
> without changing all the code accessing those fields.
>
> Similar for the word `to` — `to` applies to the words created with
> `value`, `fvalue`, `2value`. But the source code around `to foo` (and
> `foo`) depends on the kind of `foo`, so the kind of `foo` cannot be
> changed without changing the source code around where it is used.
>
> Higher level (more polymorphic) source code in Forth is possible when
> all values are boxed [1]

I don't know what compiler you use, but my values and locals
are certainly not boxed. TO et al (+TO *TO := *= ++ += *+) will
inspect their type and generate the appropriate machine code
without me having to change the source code if I change the type.