emacs-devel
[Top][All Lists]
Advanced

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

RE: adding to emacs coding standard / formatting


From: Drew Adams
Subject: RE: adding to emacs coding standard / formatting
Date: Mon, 19 Oct 2020 13:07:15 -0700 (PDT)

> > > Also, this is an opportunity to address a pet peeve: I occasionally see
> > > code either defining keybindings to lambda functions, or setting lambda
> > > functions as elements of function lists (eg. lists of hook functions).
> > > I'd like to propose that those uses be banned because of their
> > > difficulty to modify.
> >
> > Where would you allow lambda functions, then?
> 
> I see them most used as arguments/predicates to mapping functions or as
> common-lisp predicates (eg. :test).
> 
> My complaint is against their use in situations that make standard
> manipulation practices difficult: 1) When you assign a keybinding to a
> lambda function, you can't remap to it; 2) When you add a lambda
> function to a list, you lose the ability to perform operations such as
> memq, delq, and you can't modify the element in place.

Why would this be part of the code conventions?

Yes, users should be given this guidance, to save
themselves trouble (e.g. for advice and hooks).
And they should be told the reasons (i.e., told
about the potential bother).  I agree with that
whole-heartedly.

But what does this have to do with coding
conventions?  (Let alone why would such usage be
"banned".)

This is on the order of helpful tips, not coding
conventions, IMO.



reply via email to

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