all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Tony" <asideris@aqinc.com>
Subject: Re: How to write specify default values for function arguments?
Date: Tue, 1 Oct 2002 16:06:36 -0400	[thread overview]
Message-ID: <ancv1k$cc8jb$1@ID-60342.news.dfncis.de> (raw)
In-Reply-To: b00bb831.0210011045.5f29a1b4@posting.google.com

"gnuist006" <gnuist006@hotmail.com> wrote in message
news:b00bb831.0210011045.5f29a1b4@posting.google.com...
> I am looking for multiple ways for
> specifying default values for function arguments
> as you can do in C++.
>
> thanks

use &optional, any parameters left out will be nil.

(defun foo (required-arg &optional opt1 opt2)
 (unless opt1 (setq opt1 default-val-1))
 (unless opt2 (setq opt2 default-val-2))
 ...)

-Tony

  reply	other threads:[~2002-10-01 20:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01 18:45 How to write specify default values for function arguments? gnuist006
2002-10-01 20:06 ` Tony [this message]
2002-10-01 23:37   ` Kevin Rodgers

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

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

  git send-email \
    --in-reply-to='ancv1k$cc8jb$1@ID-60342.news.dfncis.de' \
    --to=asideris@aqinc.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.