(lp#1023438, thanks to Robert Uhl)
* bug fix: SB-EXT:GET-CAS-EXPANSION returned a bogus read-form when given
a SYMBOL-VALUE form with a constant symbol argument.
+ * bug fix: SB-EXT:GET-CAS-EXPANSION signaled an error when a macro expanding
+ into a DEFCAS defined place was used as the place.
* documentation: a section on random number generation has been added to the
manual. (lp#656839)
(cond
;; CAS expander.
(info
- (funcall info place environment))
+ (funcall info expanded environment))
;; Structure accessor
((setf info (info :function :structure-accessor name))
(assert (eq :bar
(eval `(let (,@(mapcar 'list vars vals))
,read-form)))))))
+(let ((foo (cons :foo nil)))
+ (defun cas-foo (old new)
+ (cas (cdr foo) old new)))
+
+(defcas foo () cas-foo)
+
+(with-test (:name :cas-and-macroexpansion)
+ (assert (not (cas (foo) nil t)))
+ (assert (eq t (cas (foo) t nil)))
+ (symbol-macrolet ((bar (foo)))
+ (assert (not (cas bar nil :ok)))
+ (assert (eq :ok (cas bar :ok nil)))
+ (assert (not (cas bar nil t)))))