[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master de6b1e1efb1: Replace XSETSYMBOL with make_lisp_symbol
From: |
Stefan Monnier |
Subject: |
Re: master de6b1e1efb1: Replace XSETSYMBOL with make_lisp_symbol |
Date: |
Sat, 02 Mar 2024 16:57:28 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>> 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.
>
> This is your stylistic preference, which I don't share, probably
> because I'm biased by many years of staring on Emacs code that uses
> such macros everywhere.
I don't have a strong opinion about whether we should keep the XSETFOO
style of macros, but I've been annoyed several times in the past at the
need to introduce a "tmp" local var just to do
XSETFOO (tmp, mything);
... tmp ...
which can turn from merely inconvenient and ugly to almost impossible
when such code needs to be used in an expression macro, which we can't
really introduce such local variables. For that reason, I started
using `make_lisp_ptr` and things along these lines.
Stefan
- Re: master de6b1e1efb1: Replace XSETSYMBOL with make_lisp_symbol,
Stefan Monnier <=