[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lions & tigers & variables - Oh my! [was: Lisp error on function :do
From: |
Emanuel Berg |
Subject: |
Re: Lions & tigers & variables - Oh my! [was: Lisp error on function :documentation] |
Date: |
Wed, 19 Oct 2022 07:16:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Drew Adams wrote:
> Yes, all of that is OT. What's not OT is that for Emacs
> users, _in particular_, special (global) vars can be
> quite useful.
>
> Precisely _because_ they can let you reach across existing
> code without modifying it [...]
But then that existing code has to use that variable. So for
the dynamic/special _and_ global variables to be useful, they
have to actually be used ;)
Let's take it from another side, I just asked what you can do
with lexical/static variables in `let'-closures, and answered
you can share them between two or several `defun', and you can
use them to keep persistent/state data between calls
to functions.
I don't know if that's a good answer in the sense that it is
complete but I know it is a good answer in the sense that it
is true because I have used let-closures exactly like that.
So we know they can do that, and global variables obviously
also can, but can global variables do something else that
they cannot?
That they can be accessed from anywhere?
So when you want that, that's when you should use them? Okay,
but then when typically do you want that? When what they
describe is so general it is just so likely that a lot of
stuff, including future stuff, will use them, so it is just
impractical to put them in a closure?
Actually in a way the whole global closure is just one big
closure for global variables I guess. It's the top-level
closure since there is nothing outside of it ...
--
underground experts united
https://dataswamp.org/~incal