* Re: master ff09851: * lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...)
[not found] ` <20210228012323.D4EF020E1B@vcs0.savannah.gnu.org>
@ 2021-02-28 8:28 ` Pip Cet
2021-02-28 15:29 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Pip Cet @ 2021-02-28 8:28 UTC (permalink / raw)
To: emacs-devel, Stefan Monnier
I really like this change.
Some nitpicks:
> +;; Record which arguments expect functions, so we can warn when those
> +;; are accidentally quoted with ' rather than with #'
> +(dolist (f '(funcall apply mapcar mapatoms mapconcat mapc cl-mapcar maphash))
But not mapcan? There are a few other map* functions which might be eligible.
> + (put f 'funarg-positions '(1)))
I think that should be `function-put' (paired with `function-get'
above), not `put'.
I'm also in favor of zero-based indexing, so I'd prefer
(function-put f 'funarg-positions '(0)).
At some point when native-comp is merged (soon, I hope!) we should
look at the function types it uses and how to expose those to
macroexp.
> +(dolist (f '( add-hook remove-hook advice-remove advice--remove-function
Just out of curiosity, is the space after '( intentional?
Pip
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: master ff09851: * lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...)
2021-02-28 8:28 ` master ff09851: * lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...) Pip Cet
@ 2021-02-28 15:29 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2021-02-28 15:29 UTC (permalink / raw)
To: Pip Cet; +Cc: emacs-devel
>> +;; Record which arguments expect functions, so we can warn when those
>> +;; are accidentally quoted with ' rather than with #'
>> +(dolist (f '(funcall apply mapcar mapatoms mapconcat mapc cl-mapcar maphash))
> But not mapcan? There are a few other map* functions which might be eligible.
Feel free to add. You could even go crazy and add a `declare` form for it ;-)
>> + (put f 'funarg-positions '(1)))
> I think that should be `function-put' (paired with `function-get'
> above), not `put'.
> I'm also in favor of zero-based indexing, so I'd prefer
> (function-put f 'funarg-positions '(0)).
I don't care very much about the color of those bikesheds.
>> +(dolist (f '( add-hook remove-hook advice-remove advice--remove-function
> Just out of curiosity, is the space after '( intentional?
From etc/NEWS:
*** A space between an open paren and a symbol changes the indentation rule.
The presence of a space between an open paren and a symbol now is
taken as a statement by the programmer that this should be indented
as a data list rather than as a piece of code.
-- Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-28 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210228012322.8694.47149@vcs0.savannah.gnu.org>
[not found] ` <20210228012323.D4EF020E1B@vcs0.savannah.gnu.org>
2021-02-28 8:28 ` master ff09851: * lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...) Pip Cet
2021-02-28 15:29 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).