[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Arguments and values to get.
- To: Fahlman@C.CS.CMU.EDU, Gregor.pa@XEROX.ARPA
- Subject: Arguments and values to get.
- From: Kent M Pitman <KMP@SCRC-STONY-BROOK.ARPA>
- Date: Fri, 20 Sep 85 10:09 EDT
- Cc: cl-object-oriented-programming@SU-AI.ARPA, Common-Lisp@SU-AI.ARPA
- In-reply-to: <FAHLMAN.12144621737.BABYL@C.CS.CMU.EDU>
- References: Msg of 19 Sep 85 19:39-EDT from Gregor.pa at Xerox.ARPA
Date: Thu, 19 Sep 1985 21:19 EDT
From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
In-reply-to: Msg of 19 Sep 1985 19:39-EDT from Gregor.pa at Xerox.ARPA
Why does Common-Lisp GET take a default-value argument instead of
returning a second value indicating whether the property actually
The default argument is useful in some cases, but admittedly is a bit
inelegant -- if you want to know for sure whether a value was found, you
have to be careful to choose some default argument that couldn't
possibly be stored in any property list. The reasoning (If I recall it
correctly) was that this occasional creation of a unique default is less
hassle than having to write an ugly multiple-value-bind every time we
want to return a default value in the property-not-found case. I'm not
sure I believe that any more.
It would be reasonable to propose a more-or-less upward-compatible extension
to GET (for CL86 or whatever) which provided that GET both accepted a argument
specifying the default to be used -and- returned two values (one the result,
the second a boolean saying whether the argument had been defaulted).