From: Daniel Colascione <dancol@dancol.org>
To: Daniel Mendler <mail@daniel-mendler.de>,
"Daniel Mendler via Emacs development discussions."
<emacs-devel@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Short functions
Date: Mon, 06 Jan 2025 12:13:54 -0500 [thread overview]
Message-ID: <8E77E1B2-0E98-43C9-9DB6-CECD79CA3A3D@dancol.org> (raw)
In-Reply-To: <87a5c37u4s.fsf@daniel-mendler.de>
On January 6, 2025 12:02:43 PM EST, "Daniel Mendler via Emacs development discussions." <emacs-devel@gnu.org> wrote:
>Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> There is also a lack in some combinators (flip, curry, uncurry, ...)
>>> which are occasionally useful. Also papply and rpapply, since
>>> apply-partially lacks conciseness and sometimes one wants apply the
>>> arguments to the right. Same with cl-constantly.
>>>
>>> (papply #'f x)
>>> (apply-partially #'f x)
>>> (lambda (y) (f x y))
>>> (lambda (y z) (f x y z))
>>>
>>> (lambda (_) x)
>>> (constantly x)
>>> (lambda (_ _) x)
>>> (cl-constantly x)
>>
>> I think you're arguing for something like `llama`s ## or to expand #'
>> to allow things like:
>
>Actually I like the explicitly named combinators (constantly, identity,
>papply, etc). Nevertheless some Llama-style syntax would be nice to have
>in Elisp. It doesn't have to reuse the #' syntax.
Sure, but it'd be nice to maintain the syntactic structure of current code instead of, say, introducing new punctuation. I used to be upset that we don't have reader macros. Now I'm not.
>
>> I'm interested to add new meanings to `function` (aka #') but mostly for
>> things like
>>
>> #'(setf foo)
>> #'(peg foo)
>>
>> to refer to the setters or the peg-matchers of a given name. It could
>> also be used for
>
>Good idea.
>
>Daniel
>
prev parent reply other threads:[~2025-01-06 17:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <173617561349.1583674.17727386803499537943@vcs3.savannah.gnu.org>
[not found] ` <20250106150015.2A1DD1043A07@vcs3.savannah.gnu.org>
2025-01-06 15:55 ` [elpa] externals/consult 4aa49ee324 3/5: consult--async-pipeline: Convert to function Stefan Monnier
2025-01-06 16:09 ` Daniel Mendler via Emacs development discussions.
2025-01-06 16:52 ` Short functions (was: [elpa] externals/consult 4aa49ee324 3/5: consult--async-pipeline: Convert to function) Stefan Monnier
2025-01-06 16:57 ` Daniel Colascione
2025-01-06 17:25 ` Short functions Stefan Monnier
2025-01-06 17:32 ` Daniel Colascione
2025-01-06 17:02 ` Daniel Mendler via Emacs development discussions.
2025-01-06 17:13 ` Daniel Colascione [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8E77E1B2-0E98-43C9-9DB6-CECD79CA3A3D@dancol.org \
--to=dancol@dancol.org \
--cc=emacs-devel@gnu.org \
--cc=mail@daniel-mendler.de \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.