[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple values and &optional
- To: gls@AQUINAS.THINK.COM
- Subject: Re: Multiple values and &optional
- From: NGALL@BBNG.ARPA
- Date: Sat, 21 Dec 1985 22:20:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: <851220170310.1.GLS@THINK-WENCESLAS.ARPA>
- Sender: NGALL@BBNG.ARPA
Date: Fri, 20 Dec 85 17:03 EST
From: Guy Steele <gls@THINK-AQUINAS.ARPA>
To: common-lisp@SU-AI.ARPA
Subject: Multiple values and &optional
Message-ID: <851220170310.1.GLS@THINK-WENCESLAS.ARPA>
Just for the record, I had an application today where I really wanted to
write something like
(MULTIPLE-VALUE-BIND (VALUE &OPTIONAL (FOUNDP T))
(FUNCALL (MAGIC-HOOK-FUNCTION THINGY) FUNNY-ARG)
(WHEN FOUNDP
(CACHE-SOME-STUFF THINGY FUNNY-ARG VALUE))
(VALUES VALUE FOUNDP))
How about:
(multiple-value-call #'(lambda (value &optional (foundp t))
(when foundp
(cache-some-stuff thingy funny-arg value))
(values value foundp))
(magic-hook-function thingy))
And I agree that MULTIPLE-VALUE-BIND should be able to take a full-blown
lambda-list.
-- Nick