[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: SETF-METHOD-FOR-SYMBOLS (version 1)
- To: "David A. Moon" <Moon@SCRC-STONY-BROOK.ARPA>
- Subject: Issue: SETF-METHOD-FOR-SYMBOLS (version 1)
- From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
- Date: Tue, 22 Sep 1987 11:54 EDT
- Cc: CL-Cleanup@SAIL.STANFORD.EDU
- In-reply-to: Msg of 22 Sep 1987 10:56-EDT from David A. Moon <Moon at STONY-BROOK.SCRC.Symbolics.COM>
- Sender: FAHLMAN@C.CS.CMU.EDU
Well, here's our setf method for Getf. It clearly is not using some
private method to get symbols right, but is using the standard setf
method for whatever the first form is. It seems to me that the way it
is using the store variable from the first subform is fairly
straightforward, and doesn't introduce more temporaries than would be
needed under your scheme, but I could be wrong.
Can you show me the Getf method that would result from your proposed way
of handling the symbol values? Is it significantly simpler or more
efficient? When it comes to efficiency, I'd rather have a little extra
variable shuffling in Getf and places like that than in all setf's
involving a symbol destination.
(define-setf-method getf (place prop &optional default &environment env)
(multiple-value-bind (temps values stores set get)
(get-setf-method place env)
(let ((newval (gensym))
(ptemp (gensym))
(def-temp (gensym)))
(values `(,@temps ,(car stores) ,ptemp ,@(if default `(,def-temp)))
`(,@values ,get ,prop ,@(if default `(,default)))
`(,newval)
`(progn (setq ,(car stores)
(%primitive putf ,(car stores) ,ptemp ,newval))
,set
,newval)
`(getf ,(car stores) ,ptemp ,@(if default `(,def-temp)))))))
-- Scott