[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Actions using symbols
From: |
alexbuhl |
Subject: |
Re: Actions using symbols |
Date: |
Mon, 02 Sep 2024 19:07:04 +0000 |
On Tuesday, September 3rd, 2024 at 5:10 AM, Heime <heimeborgia@protonmail.com>
wrote:
> 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 ?
I should have meant this actually
(let ((actn 'mapcar))
(dothat actn))