Deutsch   English   Français   Italiano  
<nnd$527858a6$7922cdd9@b990296e6c43d71c>

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

Newsgroups: comp.lang.forth
References: <nnd$2fb29a8e$298ef3f8@23fe4f00fa62d734> <874j1aycdt.fsf@nightsong.com> <nnd$68d49e22$0e1b270a@ce4705a037955a82> <73a87ff17586b02ae110516bfb76956e@www.novabbs.com>
From: albert@spenarnc.xs4all.nl
Subject: Re: Back & Forth - Co-routines
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$527858a6$7922cdd9@b990296e6c43d71c>
Organization: KPN B.V.
Date: Thu, 06 Feb 2025 12:05:07 +0100
Path: ...!weretis.net!feeder9.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feed.abavia.com!abe007.abavia.com!abp004.abavia.com!news.kpn.nl!not-for-mail
Lines: 51
Injection-Date: Thu, 06 Feb 2025 12:05:07 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
Bytes: 2199

In article <73a87ff17586b02ae110516bfb76956e@www.novabbs.com>,
HenryHH <hohl@isartext.de> wrote:
>On Tue, 4 Feb 2025 12:26:26 +0000, albert@spenarnc.xs4all.nl wrote:
>
>> ... if they are absolutely necessary I use my enhanced `[ instead
>> of any style of locals
>>
>> : root [ variable a variable b variable c ]
>>   c ! b ! a !
>>   \ now insert the famous quadratic root formula
>>   [ hide a hide b hide c ]  \ Prevent "not unique messages"
>> ;
>
>Hello Albert,
>
>why is an enhanced [ necessary for this?
>Couldn't you simply write:
>
>variable a variable b variable c
>
>: root ( a b c -- root)
>  c ! b ! a !
>\ now insert the famous quadratic root formula
>;
>
>hide a hide b hide c  \ Prevent "not unique messages"

You could, but now it doesn't look like a local variable,
isn't it?
You remark serves to show that local values (why do they call
them local variables) are largely superfluous.

P.S.
Maybe
[ variable a variable b variable c
  : D  b @ DUP * a @ b @ 4 * - ; ]
...
[ hide a .... hide D ]
...
is more convincing?

>
>Henry

Groetjes Albert
-- 
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.