[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]
From: |
Phillip Lord |
Subject: |
Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs] |
Date: |
Wed, 13 May 2020 09:58:22 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> [[[ To any NSA and FBI agents reading my email: please consider ]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> > In Clojure, a function literal is written with `#(...)`, and it
> > supports `%n` for arguments, where n=1,2,3... (Actually, I don't
> > know if Clojure supports `%10` and up or if it just goes up to
> > `%9`, but I guess that doesn't matter much). A single `%` is
> > synonymous with `%1`, which is used when there's only one
> > argument. Also supported is `%&`, which is similar to `&rest
> > <var>` in Elisp, being bound to a list containing the remaining
> > arguments.
>
> This is rather shell-like. Can we find a nicer one?
Suggest away.
> It doesn't specify how many args the literal function should accept.
> Maybe there is no need for that, but if we want to do that, how could we?
You look for the maximum argument number
#(list %) takes one argument
#(list %1 %2) takes two
#(list %1 %2 %3) takes three.
> Is there ever a need for nested literal functions? To implement them
> fully, we would want to use different arg names at each level.
You don't. They are for short functions that you pass to something
else, and for which you don't want to name parameters. For nesting, you
use lambda.
> What Lisp syntax would people suggest for this construct?
> What is available?
>
> Does anyone think this is a bad idea?
It's a small feature, and convenient for some things, but overuse makes
the code messy.
Phil
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], (continued)
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Eli Zaretskii, 2020/05/18
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Göktuğ Kayaalp, 2020/05/16
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/13
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Joost Kremers, 2020/05/12
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Stefan Monnier, 2020/05/12
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Joost Kremers, 2020/05/13
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/13
- literal functions [was: Re: dash.el], Joost Kremers, 2020/05/13
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs],
Phillip Lord <=
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/14
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/16
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Joost Kremers, 2020/05/16
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/16
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Eli Zaretskii, 2020/05/10
- RE: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Drew Adams, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Stefan Monnier, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/09
- Re: Imports / inclusion of s.el into Emacs, Dmitry Gutov, 2020/05/07
- Re: Imports / inclusion of s.el into Emacs, Richard Stallman, 2020/05/06