help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Lexical vs. dynamic: small examples?


From: Eduardo Ochs
Subject: Lexical vs. dynamic: small examples?
Date: Sat, 14 Aug 2021 00:34:31 -0300

Hi list,

I am trying to write a section on lexical vs. dynamic binding for a
tutorial on Emacs Lisp, and I am looking for very short demos that
show how things work differently in dynamic and in lexical binding...

Right now what I have is this:

  http://angg.twu.net/eev-intros/find-lexical-intro.html
  (find-lexical-intro)

I have tried really hard to the make its section "0. How to use this",
that is at:

  http://angg.twu.net/eev-intros/find-lexical-intro.html#0
  (find-lexical-intro "0. How to use this")

both clear AND useful to people who do not use eev, and I think that
the big example in section 3,

  http://angg.twu.net/eev-intros/find-lexical-intro.html#3
  (find-lexical-intro "3. `get/set'")

is quite nice - especially because of its last part, that inspects two
different getter-setter pairs, shows that their lexical environments
are the cadrs of their closures, and shows that `geta' and `seta'
share the same lexical environment and that `getb' and `setb' share
another lexical environment...

My current knowledge of lexical binding stops there, though. Any
comments (or help) would be very welcome...

  Cheers,
    Eduardo Ochs
    http://angg.twu.net/#eev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]