Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #135476
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Kragen Javier Sitaker <kragen@canonical.org> |
| Newsgroups | comp.lang.forth |
| Subject | Re: dynamic scoping in Forth in one line of code |
| Date | Sat, 29 Aug 2026 10:50:48 -0300 |
| Organization | Primarily biological and memetic |
| Lines | 14 |
| Message-ID | <87fqzx9gsn.fsf@debian> (permalink) |
| References | <87bjamc5xh.fsf@debian> <87y0dplofj.fsf@nightsong.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Sat, 29 Aug 2026 13:50:52 +0000 (UTC) |
| Injection-Info | dont-email.me; logging-data="3444132"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/S+DDaafTHvKpq1UnJk3mK"; posting-host="19c753fba95970cf1a99e4804f17687c" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
| Cancel-Lock | sha1:CQn6r6ATFSbUB/t8XqvRAIhkYaQ= sha1:SFL2K+ATHWHdcYLFb0bYPObih9c= sha256:b2cRAHdvGIGFJpMgEbk2NOFHxJUF5eEqvA8OYOjuASw= sha1:Jqs30+u3fTs/iWENoYv9bNJyzh0= sha256:opZKMWzBPldmzLUAlAF55enIfgJnyXyCLTpVyY6IdCM= |
| Xref | csiph.com comp.lang.forth:135476 |
Show key headers only | View raw
Paul Rubin <no.email@nospam.invalid> writes: > Kragen Javier Sitaker <kragen@canonical.org> writes: >> A couple of years ago, I noticed that it’s possible to implement >> Lisp-style dynamic scoping in standard Forth in one line of code: >> >> : (let!) dup @ over swap 2r> rot >r rot >r >r >r ! ; : let! (let!) 2r> ! ; > > You need to still restore the old value when the function exits by > exception or THROW. So you have to use something like CATCH. That’s an excellent point, and one I hadn’t considered. That will definitely make it more than one line. How would you implement that? Kragen
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
dynamic scoping in Forth in one line of code Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-28 18:04 -0300
Re: dynamic scoping in Forth in one line of code Paul Rubin <no.email@nospam.invalid> - 2026-08-28 18:12 -0700
Re: dynamic scoping in Forth in one line of code Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-29 10:50 -0300
Re: dynamic scoping in Forth in one line of code albert@spenarnc.xs4all.nl - 2026-08-29 12:10 +0200
Re: dynamic scoping in Forth in one line of code Kragen Javier Sitaker <kragen@canonical.org> - 2026-08-29 11:17 -0300
Re: dynamic scoping in Forth in one line of code albert@spenarnc.xs4all.nl - 2026-08-30 12:49 +0200
Re: dynamic scoping in Forth in one line of code Kragen Javier Sitaker <kragen@canonical.org> - 2026-09-01 20:38 -0300
Re: dynamic scoping in Forth in one line of code Paul Rubin <no.email@nospam.invalid> - 2026-09-01 17:15 -0700
coroutines (was Re: dynamic scoping in Forth in one line of code) Kragen Javier Sitaker <kragen@canonical.org> - 2026-09-03 20:38 -0300
Re: coroutines (was Re: dynamic scoping in Forth in one line of code) dxf <dxforth@gmail.com> - 2026-09-04 15:24 +1000
dynamic scoping in Forth in one line of code (was Re: coroutines) Kragen Javier Sitaker <kragen@canonical.org> - 2026-09-04 13:04 -0300
Re: dynamic scoping in Forth in one line of code (was Re: coroutines) dxf <dxforth@gmail.com> - 2026-09-05 02:59 +1000
csiph-web