From: Ben Good
Subject: Using "values"
Date: 
Message-ID: <tODV8.12877$AK.8317@news.webusenet.com>
I know this might seem very trivial, but can someone please tell me how the
keyword "values" returns its arguments.  Is it possible to capture these two
in a list?  Whenever I tried to, all I could capture was the first value.
Any response would be greatly appreciated.

                                                            Thanks
                                                            Ben

From: Paul F. Dietz
Subject: Re: Using "values"
Date: 
Message-ID: <3D271017.F9987F20@dls.net>
Ben Good wrote:

> keyword "values" returns its arguments.  Is it possible to capture these two
> in a list?

Use the macro MULTIPLE-VALUE-LIST.

	Paul
From: Tim Moore
Subject: Re: Using "values"
Date: 
Message-ID: <ag8iu4$62f$0@216.39.145.192>
On Sat, 6 Jul 2002 11:12:44 -0400, Ben Good <········@hotmail.com> wrote:
>I know this might seem very trivial, but can someone please tell me how the
>keyword "values" returns its arguments.  Is it possible to capture these two
>in a list?  Whenever I tried to, all I could capture was the first value.
>Any response would be greatly appreciated.
>

Multiple return values are received using the multiple-value-bind
macro.  You can capture an arbitrary number of multiple values with
the multiple-value-list macro.

As to how they are returned, they might be returned in registers, on
the stack, or in the heap :)

Tim
From: Kaz Kylheku
Subject: Re: Using "values"
Date: 
Message-ID: <agfi6u$1lu$2@luna.vcn.bc.ca>
In article <···················@news.webusenet.com>, Ben Good wrote:
> I know this might seem very trivial, but can someone please tell me how the
> keyword "values" returns its arguments.

A values expression takes its arguments and turns them into a multiple value. A
multiple value is a special mechanism built into Lisp; multiple values are not
lists and they are not arrays. They are little leprechauns; if you don't
capture them when they are returned, they vanish.  You cannot obtain a
reference to the aggregate that represents multiple values.  This is a very
beautiful thing, because the Lisp implementation can stack-allocate the cells
that hold multiple values.

> Is it possible to capture these two
> in a list?  Whenever I tried to, all I could capture was the first value.
> Any response would be greatly appreciated.

To capture the multiple values coming out of the evaluation of a form,
you must use one of the macros for that purpose. Take your pick:

  multiple-value-bind           captures multiple values as variable bindings
  multiple-value-setq           captures values by assignment to variables
  multiple-value-list           captures them by consing up a list
  multiple-value-call           bounces multiple values as args to a function

Hope this helps.