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

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

bug#66940: Dynamic scoping is all weird now?


From: Michael Heerdegen
Subject: bug#66940: Dynamic scoping is all weird now?
Date: Wed, 08 Nov 2023 04:08:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Dave Goel <deego3@gmail.com> writes:

> Thank you

Then let's close this one.

What I still wanted to say (to you): no need to complicate things using
macros here in your example.  Use functions, then variable references
are simple and clear.

If a macro (expansion) needs to refer to run-time values, use macro
arguments to pass an appropriate expression (like a variable).

But this is overkill in your case, no macros needed.  The purpose of
Lisp macros is to extend the language and/or rewrite code (at compile
time).  More or less, only that.  Always think twice if you really need
macros, try to avoid using macros when possible.  This will make the
code easier to understand and maintain.  Only if a macro introduces an
abstraction that makes the code actually easier to understand justifies
using one.

Michael.





reply via email to

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