[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about optional arguments
From: |
David Kastrup |
Subject: |
Re: question about optional arguments |
Date: |
08 Jan 2004 23:51:34 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
"leo" <halloleo@noospaam.myrealbox.com> writes:
> "David Kastrup" <dak@gnu.org> wrote in message
> x57k03c5rm.fsf@lola.goethe.zz">news:x57k03c5rm.fsf@lola.goethe.zz...
> > "leo" <halloleo@noospaam.myrealbox.com> writes:
> >
> > > i want to call dired-get-marked-files with the specific value 1 for
> > > secend argument arg but without a value for the first argument localp,
> >
> > Is that a trick question?
>
> no, probably just a stupid question, sorry.
>
> > (dired-get-marked-files nil 1)
>
> thanks david, i didn't know that nil is as good as no argument.
Then it would not have done harm to look up argument lists in the
manual:
A call to the function requires one actual argument for each of the
REQUIRED-VARS. There may be actual arguments for zero or more of the
OPTIONAL-VARS, and there cannot be any actual arguments beyond that
unless the lambda list uses `&rest'. In that case, there may be any
number of extra actual arguments.
If actual arguments for the optional and rest variables are omitted,
then they always default to `nil'. There is no way for the function to
distinguish between an explicit argument of `nil' and an omitted
argument. However, the body of the function is free to consider `nil'
an abbreviation for some other meaningful value. This is what
`substring' does; `nil' as the third argument to `substring' means to
use the length of the string supplied.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum