GNU bug report logs - #23736
Add companion to apply-partially

Previous Next

Package: emacs;

Reported by: Rasmus <rasmus <at> gmx.us>

Date: Thu, 9 Jun 2016 14:03:01 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Rasmus <rasmus <at> gmx.us>
Cc: 23736 <at> debbugs.gnu.org
Subject: bug#23736: Add companion to apply-partially
Date: Sun, 28 Jul 2019 14:05:55 +0200
Rasmus <rasmus <at> gmx.us> writes:

> Could we add an ‘apply-rpartially’ or ‘apply-partially-last’ to subr.el?
> Like ‘apply-partially’, but fixing the last arguments.  This is useful for
> e.g. ‘set-face-attribute’ where one might a common :inherits to many
> faces, e.g.
>
>     (mapc (apply-rpartially ’set-face-attribute :inherit ’fixed-pitch) ’(list of faces))
>
> I have used this in my init.el,
>
>     (defun apply-rpartially (fun &rest args)
>       "Return a function that is a partial application of FUN to ARGS.
>     ARGS is a list of the last N arguments to pass to FUN.  The
>     result is a new function which does the same as FUN, except that
>     the last N arguments are fixed at the values with which this
>     function was called."
>       (lambda (&rest args1)
>         (apply fun (append args1 args))))

(I'm going through old Emacs bug reports that haven't received any
response.)

I think this sounds like a slightly too obscure function to add to Emacs
core.  apply-partially is more useful because functions are often
constructed in ways that makes that a convenient function, while the
opposite order is more unusual, I think?

(And especially with lexical support doing this sort of thing is often
easier, anyway.)

So I'm closing this as a "wontfix".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.