Deutsch   English   Français   Italiano  
<20240417133955.00004d23@gmail.com>

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

Path: ...!feeds.phibee-telecom.net!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: John Ames <commodorejohn@gmail.com>
Newsgroups: comp.unix.programmer,comp.lang.misc,comp.unix.shell
Subject: Re: on Perl
Date: Wed, 17 Apr 2024 13:39:55 -0700
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20240417133955.00004d23@gmail.com>
References: <uu54la$3su5b$6@dont-email.me>
	<87edbtz43p.fsf@tudado.org>
	<0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
	<20240408075547.000061e8@gmail.com>
	<g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
	<uvbe3m$2cun7$1@dont-email.me>
	<Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
	<pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid>
	<uvk8o6$h2pg$3@dont-email.me>
	<20240415152951.000079ab@gmail.com>
	<uvkbec$hjeq$1@dont-email.me>
	<uvlc1f$rgng$1@dont-email.me>
	<slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de>
	<uvlp8g$u62e$1@dont-email.me>
	<87wmowv9fy.fsf@eder.anydns.info>
	<20240417080523.00005e99@gmail.com>
	<uvp6gv$1onkq$1@dont-email.me>
	<20240417121909.000039a3@gmail.com>
	<uvp996$1p6tk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Apr 2024 22:39:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7a885d53952e506d4bfe7e1038b86033";
	logging-data="1879868"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+vUwlWWxCMNdkZKAKdTodOMep5M1AeVlQ="
Cancel-Lock: sha1:bXxdhIcS7BO/Kbu6I1AuEyMDTLk=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
Bytes: 2920

On Wed, 17 Apr 2024 21:52:06 +0200
David Brown <david.brown@hesbynett.no> wrote:

> I think that when finding the definition of a word, Forth just
> searches back through the stack of definitions until it gets a hit.
> And if that word definition uses other non-primitive words, it goes
> backwards from where it currently is, looking only at definitions
> from before the current word was defined.  Is that right?  And if so,
> can you do "forward declarations", and mutual recursion somehow?

That's my understanding, yes; essentially, it's a consequence of the
fact that definitions are stored as a list of pointers, and re-
definitions are simply appended to the dictionary without going back
through the rest of it to update any pointers to the prior definition.
A strange design choice, but they're consistent with it.

Forward declarations are possible using the CREATE ... DOES> construct,
which creates a definition that invokes a function pointer which can be
changed later. I dunno about mutual recursion, but it wouldn't shock me
if the same trick could be applied for that.

(And yes, if we ought to pare this back to comp.lang.misc we certainly
can.)