Sujet : Re: Nested definitions
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 02. Jul 2025, 16:12:00
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jul2.171200@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6
User-Agent : 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.htmlcomp.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/