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

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

Re: curious why private variables are rare


From: Stefan Monnier
Subject: Re: curious why private variables are rare
Date: Sat, 19 Nov 2022 22:53:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> even when var is only used by fun.  but you could do:
>
>   (let ((var ...))
>     (defun fun ...))

Indeed.

> so I am just curious why the usual thing is usual.  is it the above
> reasons?  or am i missing some bigger things?

Most likely it's because it started working quite late in the history of
ELisp, so habits were taken at a stage where it wasn't an option.

Side note: the above works, but the compiler doesn't understand it well
enough, which leads to some minor/invisible effects (the .elc file is
marginally less efficient) and some less invisible effects (code after
that `let` will get spurious warnings (about a call to unknown function)
if it calls `fun`) :-(


        Stefan




reply via email to

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