emacs-devel
[Top][All Lists]
Advanced

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

Re: master baf1a7a4a0: Turn gv-synthetic-place into a function


From: Howard Melman
Subject: Re: master baf1a7a4a0: Turn gv-synthetic-place into a function
Date: Thu, 22 Sep 2022 10:11:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So I'd rather keep "generalized variable", long and unwieldy as it is.
> I think we should avoid "place" as much as possible, though.

+1

I've written elisp for decades but am not completely
comfortable with the "new" stuff like cl-lib and gv and it
took me a little to wrap my head around setf.

I like the term "Generalized Variable" and would prefer to
see "gv" used instead of "place".

The beginning of the Generalized Variables section of the
elisp manual is fine for me and mostly the sub-section
"12.17.1 The ‘setf’ Macro".  But referring to "the left
side" of a sexp doesn't help me, e.g., "The ‘setf’ form is
like ‘setq’, except that it accepts arbitrary place forms on
the left side rather than just symbols. For example, ‘(setf
(car a) b)’..."  I can follow the rest but I don't think of
"the first argument" to setq as "the left side".

And I think rather than

 -- Macro: setf [place form]...
     This macro evaluates FORM and stores it in PLACE, which must be a
     valid generalized variable form.  If there are several PLACE and
     FORM pairs, the assignments are done sequentially just as with
     ‘setq’.  ‘setf’ returns the value of the last FORM.

I'd prefer

 -- Macro: setf [gv val]...
     This macro evaluates VAL and stores it in GV, which must be a
     valid generalized variable form.  If there are several GV and
     VAL pairs, the assignments are done sequentially just as with
     ‘setq’.  ‘setf’ returns the value of the last VAL.

I find it much easier to process GV as "generalized
variable" rather than "place", as long as each docstring where
I run across GV uses "generalized variable" someplace so I
could look up the term.  I'm less invested in changing
"form" above to "val" but did it for two reasons: it matches
what setq calls its second argument (and the actual setf
docstring) and it doesn't reuse the term "form" which is
used in the description of the first argument.  I'm fine
thinking of lisp forms, but since everything is a form, I'd
rather actually name arguments to differentiate them when
possible. 

Just my $0.02

-- 

Howard




reply via email to

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