Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: dynamic scoping in Forth in one line of code Date: Tue, 01 Sep 2026 17:15:12 -0700 Organization: A noiseless patient Spider Lines: 15 Message-ID: <87ecfcld9r.fsf@nightsong.com> References: <87bjamc5xh.fsf@debian> <874igd9fjt.fsf@debian> <875x0oa6fy.fsf@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 02 Sep 2026 00:15:13 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2415398"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OY5w0G7H/lV0X6Wui+0JD"; posting-host="f76fb290cf12d7a8e7a9ec222d0b2cb1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:jWMzu3BDuUE5A/qv0Sy8AOsjHI8= sha1:7D4BdYQj+nEiJOBzp7fwxdVbw0w= sha256:HoY6VjS2aIQ7hv43Mn+0/FGyT/IIca9ZQ/2GsOe3HAk= sha1:S9z2o7Nv52486YjFHiHc3V6YvrM= sha256:gR4plY24OBPeBmbGj4r/qLP2XQaerBOXB1iKQXTkJsw= Xref: csiph.com comp.lang.forth:135518 Kragen Javier Sitaker writes: > I think you’ve internalized it sufficiently that it’s not surprising to > you, but it was surprising to me when I encountered it a year and a half > ago, at which point I’d been programming for 43 years and occasionally > programming in Forth for 27 years. Maybe I'm just a slow learner. The idea has been in the literature for a long time (it's discussed at length in Knuth vol. 1 from 1968), but I think it wasn't well understood in the programming community til much more recently. This might be of interest: https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/coroutines-philosophy/ CO is similar to Knuth's (TAOCP's) coroutine jump as explained in the "Coroutine paradigms" section of the article, I think.