[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master de6b1e1efb1: Replace XSETSYMBOL with make_lisp_symbol
From: |
Mattias Engdegård |
Subject: |
Re: master de6b1e1efb1: Replace XSETSYMBOL with make_lisp_symbol |
Date: |
Sat, 24 Feb 2024 21:54:39 +0100 |
24 feb. 2024 kl. 19.23 skrev Eli Zaretskii <eliz@gnu.org>:
> Why is this a good idea? We have those XSET* macros in Emacs since
> time immemoriam; why remove them now?
There is no longer any reason for having those macros now, nor has there been
for a very long time. Several uses of XSETSYMBOL were eliminated in the obarray
renovation so this is just me finishing that part of the job. We did the same
with XSET_HASH_TABLE and it was a clear improvement.
More in detail, `a=f(b)` is inherently simpler, more transparent, concise and
composable than `X(a,b)`. It is obvious to the reader that it's an assignment
and that `a` is only modified, `b` not at all and is only evaluated once. There
is no need for an assignment at all if the result is used elsewhere.
Another reason for removing remaining uses of the macro is that then the macro
itself can be removed, which in turn ensures that no new uses of it will appear.