[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing a list of symbols to function argument
From: |
Heime |
Subject: |
Re: Passing a list of symbols to function argument |
Date: |
Fri, 29 Nov 2024 22:45:43 +0000 |
> > > > For the interactive call I want to pass the three values so that
> > > > actm-seqr will be a list of three objects.
> > > >
> > > > Thus I do
> > > >
> > > > (list (list colw rsel scope))
> > > >
> > > > Would the above be correct?
> > >
> > > Yes.
> > >
> > > > With only (list colw rsel scope) emacs does complain.
> > >
> > > Because that means the interactive call passes three arguments, but your
> > > definition of `poalatuk' only specifies one argument parameter.
> > >
> > > > I wonder whether actm-seqr will give me ((72 tabtrail global))
> > > > and not (72 tabtrail global).
> > >
> > > I don't know what you mean; actm-seqr is the function parameter, a
> > > variable whose value is whatever is passed on calling the function
> > > either interactively or noninteractively.
> >
> > For the interactive part, would returning
> >
> > (list (list colw (intern rsel) (intern scope)))
> >
> > pass
> >
> > ((72 tabtrail global)) ; list with single element being a list
> >
> > or
> >
> > (72 tabtrail global) ; list of three entries
> >
> > to actm-seqr?
>
>
> The answer is in message displayed when you do `M-x poalatuk' and act
> appropriately on the prompts, isn't it?
With only
(list colw rsel scope)
rather than
(list (list colw rsel scope))
I get
Debugger entered--Lisp error: (wrong-number-of-arguments ((t) (actm-seqr)
"Visualisation of spaces including tabs and trailin..."
poalatuk(72 "tabtrail" "local")
> > > > Have also been looking at the possibility of using
> > > >
> > > > (list (list colw (intern rsel) (intern scope)))
> > > >
> > > > Or would this be considered replication? Because the call
> > > > to intern would happen later anyway.
> > >
> > > Then it would cause the error you reported in your OP.
> >
> > (list (list colw (intern rsel) (intern scope)))
> >
> > The above will be for the interactive part, so that the string values
> > would be changed immediately to symbols.
> >
> > And since I now fixed the problem by checking with stringp so intern gets
> > called when calling the function programatically with strings.
>
>
> Ok.
>
> Steve Berman
- Passing a list of symbols to function argument, Heime, 2024/11/29
- Re: Passing a list of symbols to function argument, Stephen Berman, 2024/11/29
- Re: Passing a list of symbols to function argument, Heime, 2024/11/29
- Re: Passing a list of symbols to function argument, Stephen Berman, 2024/11/29
- Re: Passing a list of symbols to function argument, Heime, 2024/11/29
- Re: Passing a list of symbols to function argument, Stephen Berman, 2024/11/29
- Re: Passing a list of symbols to function argument, Heime, 2024/11/29
- Re: Passing a list of symbols to function argument, Stephen Berman, 2024/11/29
- Re: Passing a list of symbols to function argument,
Heime <=