[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Arguments and values to get.
- Subject: Arguments and values to get.
- From: System Files <SYS@SU-AI.ARPA>
- Date: Thu, 03 Oct 1985 18:36:00 -0000
Received: from SCRC-QUABBIN.ARPA by SU-AI.ARPA with TCP; 3 Oct 85 14:36:29 PDT
Received: from NEPONSET.SCRC.Symbolics.COM by SCRC-QUABBIN.ARPA via CHAOS with CHAOS-MAIL id 207346; Thu 3-Oct-85 17:40:11-EDT
Date: Thu, 3 Oct 85 17:39 EDT
From: David C. Plummer <DCP@SCRC-QUABBIN.ARPA>
Subject: Arguments and values to get.
To: Gregor.pa@XEROX.ARPA, Scott E. Fahlman <Fahlman@C.CS.CMU.EDU>,
Kent M Pitman <KMP@SCRC-STONY-BROOK.ARPA>, Common-Lisp@SU-AI.ARPA
(incf (get foo bar))
when the property does not exist. INCF would die adding to NIL. Thus,
to maintain simple style, you need
(incf (get foo bar 0))
I think this is a LOT prettier than
(setf (get foo bar)
(multiple-value-bind (value valid-p)
(get foo bar)
(if valid-p (1+ value) 1)))
and the programmer doesn't have to worry about multiple evaluation of
FOO and BAR, since INCF is supposed to take care of that.