Subject: Re: Compact multiple-value returns
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 10 Nov 2005 03:48:06 -0600
Newsgroups: comp.lang.lisp
Message-ID: <S-WdnWm-6P_Liu7eRVn-rA@speakeasy.net>
Thomas Schilling  <tjs_ng@yahoo.de> wrote:
+---------------
| Christophe Rhodes wrote:
| >>Surely it's the sort of pattern that comes up all the time??
| > Not really.
| 
| To the OP: In (mostly) functional languages one should prefer binding to
| mutating. I.e.:
| 
|   (multiple-value-bind a b c (foo ...)
|      ...use a b c...)
+---------------

In Common Lisp, it's written this way:

    (defun foo ()
      (values 23 45 67))

    (multiple-value-bind (a b c)
          (foo)			; This is usually indented 4 spaces
      ...use a b c...)


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607