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

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

Re: Making alist that executes multiple commands


From: Stephen Berman
Subject: Re: Making alist that executes multiple commands
Date: Mon, 25 Nov 2024 23:09:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

On Mon, 25 Nov 2024 21:59:53 +0000 Heime <heimeborgia@protonmail.com> wrote:

> About your comment
>
>> That seems fine if the functions take no arguments, though probably not
>> as flexible as looping over a list.
>
> You provided the examples
>
> (funcall 'alkotr-ar ar)
> (funcall 'alkotr-ar af)
>
> But I did not understand how to inceorporate this idea.  With
> my lambda function, I can also pass arguments to my commands.
>
> I did not understand the implication of the following in my case.
>
> (dolist (f '(+ - list))
>   (dolist (a '(1 2 3))
>     (funcall f a)))
>
> Thusly, I do not understand what "allow arguments to be freely combined"
> actually means practically.

It produces all combinations of function calls comprised of one of the
functions f and one of the arguments a; I did not mean to imply anything
else.  If it doesn't help with your use case, then of course don't use
it.

Steve Berman



reply via email to

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