* Re: master b2e2128: Use lexical-binding in webjump.el and add tests
[not found] ` <20200518155821.3673B20A2C@vcs0.savannah.gnu.org>
@ 2020-05-18 19:40 ` Lars Ingebrigtsen
2020-05-18 20:23 ` Noam Postavsky
2020-05-18 21:18 ` Stefan Monnier
0 siblings, 2 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-05-18 19:40 UTC (permalink / raw)
To: emacs-devel
Simen Heggestøyl <simenheg@gmail.com> writes:
> * lisp/net/webjump.el: Use lexical-binding.
> (webjump-read-url-choice): Remove redundant 'function' around lambda.
This seems like a good thing, but it made me curious as to how many
(function (lambda ...)) things there are in Emacs. Just naive grepping
showed me ~300 of them; I'm guessing there's even more.
Most look like they can definitely be removed:
(setq split-by-major-mode
(sort split-by-major-mode
(function (lambda (elt1 elt2)
(> (length elt1) (length elt2))))))
But there's a lot of these things:
(put 'pascal 'math-radix-formatter
(function (lambda (r s)
(if (= r 16) (format "$%s" s)
(format "%d#%s" r s)))))
Does the `function' here have any meaning, or is it superfluous?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: master b2e2128: Use lexical-binding in webjump.el and add tests
2020-05-18 19:40 ` master b2e2128: Use lexical-binding in webjump.el and add tests Lars Ingebrigtsen
@ 2020-05-18 20:23 ` Noam Postavsky
2020-05-18 21:18 ` Stefan Monnier
1 sibling, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2020-05-18 20:23 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Emacs developers
On Mon, 18 May 2020 at 15:40, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> (function (lambda (r s)
> Does the `function' here have any meaning, or is it superfluous?
It has meaning, and it's superfluous because the lambda macro expands
into a function form if you omit it.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: master b2e2128: Use lexical-binding in webjump.el and add tests
2020-05-18 19:40 ` master b2e2128: Use lexical-binding in webjump.el and add tests Lars Ingebrigtsen
2020-05-18 20:23 ` Noam Postavsky
@ 2020-05-18 21:18 ` Stefan Monnier
2020-05-19 12:40 ` Lars Ingebrigtsen
1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2020-05-18 21:18 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: emacs-devel
> (setq split-by-major-mode
> (sort split-by-major-mode
> (function (lambda (elt1 elt2)
> (> (length elt1) (length elt2))))))
>
> But there's a lot of these things:
>
> (put 'pascal 'math-radix-formatter
> (function (lambda (r s)
> (if (= r 16) (format "$%s" s)
> (format "%d#%s" r s)))))
>
> Does the `function' here have any meaning, or is it superfluous?
It has the same meaning in both cases: in both cases (function (lambda ...))
is an argument to a function (`sort` in the first case and `put` in the
second).
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: master b2e2128: Use lexical-binding in webjump.el and add tests
2020-05-18 21:18 ` Stefan Monnier
@ 2020-05-19 12:40 ` Lars Ingebrigtsen
0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-05-19 12:40 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> (put 'pascal 'math-radix-formatter
>> (function (lambda (r s)
>> (if (= r 16) (format "$%s" s)
>> (format "%d#%s" r s)))))
>>
>> Does the `function' here have any meaning, or is it superfluous?
>
> It has the same meaning in both cases: in both cases (function (lambda ...))
> is an argument to a function (`sort` in the first case and `put` in the
> second).
The English language changes so quickly these days! That's an entirely
new way of spelling "`function' here has no meaning, and it's
superfluous", I guess.
Anyway, I guess that means that somebody who wants do some cleaning up
has a new thing to grep for.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-19 12:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200518155819.860.31976@vcs0.savannah.gnu.org>
[not found] ` <20200518155821.3673B20A2C@vcs0.savannah.gnu.org>
2020-05-18 19:40 ` master b2e2128: Use lexical-binding in webjump.el and add tests Lars Ingebrigtsen
2020-05-18 20:23 ` Noam Postavsky
2020-05-18 21:18 ` Stefan Monnier
2020-05-19 12:40 ` Lars Ingebrigtsen
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).