[Top][All Lists]

[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.


reply via email to

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