bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#49316: Add apply-partially's right version


From: daanturo
Subject: bug#49316: Add apply-partially's right version
Date: Mon, 5 Jul 2021 11:29:15 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 7/3/21 9:13 PM, Phil Sainty wrote:
On 2021-07-03 15:06, Michael Heerdegen wrote:
A placeholder (e.g. the symbol `_' which should normally be unbound)
stands for an argument that is used from the args provided in the actual
call:

(defalias 'my-list-with-some-elts
  (applying-partially (list 0 _ 2 _ 4)))

(my-list-with-some-elts 'a 'b 'c 'd) ; => (0 a 2 b 4 c d)

I like the flexibility of the placeholder approach.  I'm not
sold on the extra parens used here -- I don't feel too strongly
about it, but it's inconsistent with how `apply-partially' is
called.

The author has mentioned that the reason for being a macro with extra
parentheses was the ability to work with `eldoc`: inside the inner pair of
parentheses, we can look at parameters suggestion which is normally not possible
with `apply-partially`.

`applying-partially` is bit confusing given the name of the existing function.
To differentiate it, can we name this macro differently? Like
`any-partial-application`, `partially-apply-at_`, etc.

--

Daanturo.






reply via email to

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