unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Passing a list of symbols to function argument
Date: Fri, 29 Nov 2024 22:45:43 +0000	[thread overview]
Message-ID: <-pNNoKQIEPZicROSgGBiVJrfyTKFJ6G_mlwxErytQ6cMKhQ6APevkEq-MQNYAaUlevdzXi2v-5v_iacDZCKK3qJG0YXPvcmxdAO9U9cY8r8=@protonmail.com> (raw)
In-Reply-To: <87cyid7lnq.fsf@gmx.net>

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



      reply	other threads:[~2024-11-29 22:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 17:34 Passing a list of symbols to function argument Heime via Users list for the GNU Emacs text editor
2024-11-29 19:54 ` Stephen Berman
2024-11-29 20:15   ` Heime via Users list for the GNU Emacs text editor
2024-11-29 20:41     ` Stephen Berman
2024-11-29 21:16       ` Heime via Users list for the GNU Emacs text editor
2024-11-29 21:29         ` Stephen Berman
2024-11-29 21:41           ` Heime via Users list for the GNU Emacs text editor
2024-11-29 21:52             ` Stephen Berman
2024-11-29 22:45               ` Heime via Users list for the GNU Emacs text editor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='-pNNoKQIEPZicROSgGBiVJrfyTKFJ6G_mlwxErytQ6cMKhQ6APevkEq-MQNYAaUlevdzXi2v-5v_iacDZCKK3qJG0YXPvcmxdAO9U9cY8r8=@protonmail.com' \
    --to=help-gnu-emacs@gnu.org \
    --cc=heimeborgia@protonmail.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).