[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lexical vs. dynamic: small examples?
From: |
Emanuel Berg |
Subject: |
Re: Lexical vs. dynamic: small examples? |
Date: |
Sat, 14 Aug 2021 23:26:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
tomas wrote:
> If you add nonlocal exits (exceptions, setjmp/longjmp,
> continuations), you are in hot water ;-)
Let's see, an exception is an exception...
setjmp/longjmp are C functions to save state and then
restore/resume execution at a specific location after
an error.
A continuation - the functional equivalent of the GOTO
statement <https://en.wikipedia.org/wiki/Continuation> - is
used in continuation-passing style computing, CPS, where an
explicit continuation function is sent to a function and
that gets called with the value instead of returning it.
So if f(a, f') = f'(f(a)) then f' is the continuation?
"Nonlocal exits unbind all variable bindings made by the
constructs being exited."
<https://www.gnu.org/software/emacs/manual/html_node/elisp/Nonlocal-Exits.html>
--
underground experts united
https://dataswamp.org/~incal
RE: [External] : Lexical vs. dynamic: small examples?, Drew Adams, 2021/08/14
Re: Lexical vs. dynamic: small examples?, Gregory Heytings, 2021/08/14
Re: Lexical vs. dynamic: small examples?, tomas, 2021/08/14