[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Actions using symbols
From: |
Heime |
Subject: |
Re: Actions using symbols |
Date: |
Mon, 02 Sep 2024 17:10:15 +0000 |
Sent with Proton Mail secure email.
On Tuesday, September 3rd, 2024 at 1:38 AM, Manuel Giraud via Users list for
the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Heime heimeborgia@protonmail.com writes:
>
> > I customarily make symbols that I can check on as conditionals
> >
> > (defun myfunc (actn)
> > (when (eq actn 'something) dothis)
> >
> > Would things go wrong should I start using function names as arguments
>
>
> No.
>
> > For instance, myfunc would use a mapcar implementation when ACTN is
> > 'mapcar and an apply-partially implementation when ACTN is 'apply-partially
> >
> > (defun myfunc (actn)
> > (when (eq actn 'mapcar) dothis)
> > (when (eq actn 'apply-partially) dothat)
>
>
> This is correct code.
> --
> Manuel Giraud
What happens when I do (let ((actn 'mapcar)) ? It is actually setting
actn to the 'mapcar symbol. When one defines the function mapcar, does
elisp also make the symbol 'mapcar ?
(let ((actn 'mapcar))
dothat(actn))