[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #f = #none ?
- To: samp@kurz-ai.com (Sam Pilato)
- Subject: Re: #f = #none ?
- From: Bob Kerns <rwk@crl.dec.com>
- Date: Thu, 19 Nov 92 13:44:37 -0500
- Cc: cfry@mit.edu, info-dylan@cambridge.apple.com
- In-reply-to: Your message of "Thu, 19 Nov 92 10:18:44 EST." <9211191518.AA16847@taiyo.kurz-ai.com>
Date: Thu, 19 Nov 92 10:18:44 EST
From: samp@kurz-ai.com (Sam Pilato)
(multiple-value-call #'foo
(if frob-p
(values :frob frob-val)
(values))
:blech bletch-val)
I agree with Fry. I would much prefer being able to:
(foo :frob (if frob-p frob-val <use-the-default-value>)
:blech bletch-val)
I wasn't disagreeing with Fry. But I would not like there
to be some distinguished value which could not be passed
in, because it would be interpreted as "use the default value".
What if you remodularize your code, so that the appropriate
place to do the defaulting is not in that function, but instead
in a function three levels of call down?
The multiple-value-call construct has the correct semantics.
The syntax is awkward. However, you can package it up in
macros:
(defaulting foo :frob (if frob-p frob-val :use-default)
:blech bletch-val).