unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: luca.spinacci@seleniacomms.com
Subject: Argument-list in function with variable number of arguments...
Date: Fri, 20 May 2005 16:17:36 +0200	[thread overview]
Message-ID: <OFB5B1634E.C41F21D3-ONC1257007.0052922F@SeleniaComms.com> (raw)


Is there a way to have a variable number of arguments in
a function argument-list?
I know how to write a function in which a fixed number of arguments
is expected for ex.

( defun my-function ( first second )
   (interactive "sFirst : \nsSecond : ")
   (insert ""first"\n"
                ""second"\n")
)

So I'm asked for "first" and for "second"...and my-function
inserts the two of them in a buffer.
I would like to have more arguments (let's say n) and being
asked for them interactively, for instance:
How many arguments? : 5 <Ret>
First : first_argument <Ret>
Second : second_argument <Ret>
Third : third_argument <Ret>
...and so on without knowing their number in advance.

Is it possible?
Thank you very much,
Luca.

             reply	other threads:[~2005-05-20 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-20 14:17 luca.spinacci [this message]
2005-05-20 15:15 ` Argument-list in function with variable number of arguments Kevin Rodgers
     [not found] <mailman.1029.1116599428.25862.help-gnu-emacs@gnu.org>
2005-05-20 15:00 ` Pascal Bourguignon

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=OFB5B1634E.C41F21D3-ONC1257007.0052922F@SeleniaComms.com \
    --to=luca.spinacci@seleniacomms.com \
    /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).