| Deutsch English Français Italiano |
|
<2025Jul2.171200@mips.complang.tuwien.ac.at> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Nested definitions
Date: Wed, 02 Jul 2025 15:12:00 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 31
Message-ID: <2025Jul2.171200@mips.complang.tuwien.ac.at>
References: <1f433fabcb4d053d16cbc098dedc6c370608ac01@i2pn2.org> <2025Jun23.071834@mips.complang.tuwien.ac.at> <a004d0f4acf945e054db77d86a4544fc@www.novabbs.com> <1042s2o$3d58h$1@dont-email.me> <nnd$42f4ab46$0b513441@af5c09ac13877827> <1043831$3ggg9$1@dont-email.me>
Injection-Date: Wed, 02 Jul 2025 17:20:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e5f2917e964f65b72bdc102b356cbad9";
logging-data="3767258"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19D2sW8LkIP12YjYH37hwAS"
Cancel-Lock: sha1:Op3+AxprwVCmiXXWPPBDE36/92Y=
X-newsreader: xrn 10.11
Ruvim <ruvim.pinka@gmail.com> writes:
>On 2025-07-02 15:37, albert@spenarnc.xs4all.nl wrote:
>> Or it has not even know it, if [ is smart enough to compile a jump to
>> after ].
>
>This can be tricky because the following should work:
>
> create foo [ 123 , ] [ 456 ,
>
> : bar [ ' foo compile, 123 lit, ] ;
Or something. Anyway, [ and ] are used for a variety of purposes and
trying to smarten them seems fraught with pitfalls. If one really
wants to have
: foo ... [ : bar ... ; ] ... ;
work, it may be better to put the smarts into : and ;. E.g., on a
system with sections, they could switch to another section and back.
The benefit of defining a normal colon definition inside another colon
definition eludes me, however. Maybe mutual recursion, but the need
is rare and deferred words handle that well.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/
EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/