From: ssecorp
Subject: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <75229419-af0f-443d-acd3-607d678bdd94@w7g2000hsa.googlegroups.com>
What is the best reference manual for common lisp?
And one that follows the ANSI standard and thus works for both
allegro, sbcl etc.

From: Mikael Jansson
Subject: Re: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <d0124f61-3096-4bd7-aa86-68b2988d23fc@m36g2000hse.googlegroups.com>
On Aug 23, 10:39 pm, ssecorp <············@gmail.com> wrote:
> What is the best reference manual for common lisp?
> And one that follows the ANSI standard and thus works for both
> allegro, sbcl etc.

Try the HyperSpec. http://www.lispworks.com/documentation/HyperSpec/Front/index.htm
(lisp.org is down at the moment).

If you're using a Debian-based distribution, you can apt-get the
package "hyperspec".

--
Mikael Jansson
From: ssecorp
Subject: Re: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <496c3148-ceb1-4c42-b3ef-d1721cffa9fc@m36g2000hse.googlegroups.com>
Thanks, also I forgot to actually ask the questions.

1. How to use optional arguments?

2. How to handle unknown amount of arguments? in scheme it is ". args"
From: Barry Margolin
Subject: Re: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <barmar-68404F.17522223082008@newsgroups.comcast.net>
In article 
<····································@m36g2000hse.googlegroups.com>,
 ssecorp <············@gmail.com> wrote:

> Thanks, also I forgot to actually ask the questions.
> 
> 1. How to use optional arguments?

http://www.lispworks.com/documentation/HyperSpec/Body/03_da.htm

The simple case is like this:

(defun foo (a &optional b c) ...)

B and C are optional, and default to NIL when not supplied.  Read the 
Hyperspec for the details on how to specify a different default and how 
to tell whether the argument was supplied or defaulted.

> 
> 2. How to handle unknown amount of arguments? in scheme it is ". args"

In CL it's "&rest args".

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Tamas K Papp
Subject: Re: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <6hcgifFjv3ivU1@mid.individual.net>
On Sat, 23 Aug 2008 14:33:14 -0700, ssecorp wrote:

> Thanks, also I forgot to actually ask the questions.

You also forgot to read an into book before asking very, very basic 
questions.  Paul Graham's ANSI Common Lisp and Peter Seibel's Practical 
Common Lisp come to mind.  The second is available online.  Both are good 
investments to own in dead tree format.

Tamas
From: Barry Margolin
Subject: Re: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <barmar-6555AD.17262223082008@newsgroups.comcast.net>
In article 
<····································@w7g2000hsa.googlegroups.com>,
 ssecorp <············@gmail.com> wrote:

> What is the best reference manual for common lisp?
> And one that follows the ANSI standard and thus works for both
> allegro, sbcl etc.

Did you really intend to ask a different question in the body of your 
message than in the Subject?  Did you start out wanting to ask questions 
about argument lists, but then change your mind and forget to change the 
subject?

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Jens Teich
Subject: Re: How to use optional and unknow amount of arguments?
Date: 
Message-ID: <m27ia7cqly.fsf@jensteich.de>
ssecorp <············@gmail.com> writes:

> What is the best reference manual for common lisp?
> And one that follows the ANSI standard and thus works for both
> allegro, sbcl etc.


Read Peter Seibels Practical Common Lisp, online available at
http://www.gigamonkeys.com/book/

Jens