[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #f = #none ?



    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).