Commit ab6d1bd5 authored by Luís Oliveira's avatar Luís Oliveira
Browse files

sbcl: be more careful with SB-C::META-INFO

SB-C::META-INFO was renamed from SB-C::TYPE-INFO in SBCL 1.2.10, so
let's try not to intern it on versions older than that.

Also, refactor the :setf :inverse test in the process.

Fixes gh issue #306.
parent 920b99ee
Showing with 20 additions and 3 deletions
+20 -3
2016-03-21 Luís Oliveira <loliveira@common-lisp.net>
* swank/sbcl.lisp (sbcl-with-setf-inverse-meta-info): Backwards
compatibility test for :setf :inverse info that takes special care
not to trip on package locks due to interning SB-C::META-INFO on
older SBCLs.
(setf-expander): Use it.
2016-03-21 Luís Oliveira <loliveira@common-lisp.net>
 
* swank/backend.lisp (boolean-to-feature-expression): New function.
......
......@@ -41,7 +41,16 @@
(with-symbol 'who-calls 'sb-introspect))
;; ... for restart-frame support (1.0.2)
(defun sbcl-with-restart-frame ()
(with-symbol 'frame-has-debug-tag-p 'sb-debug)))
(with-symbol 'frame-has-debug-tag-p 'sb-debug))
;; ... for :setf :inverse info (1.1.17)
(defun sbcl-with-setf-inverse-meta-info ()
(boolean-to-feature-expression
;; going through FIND-SYMBOL since META-INFO was renamed from
;; TYPE-INFO in 1.2.10.
(let ((sym (find-symbol "META-INFO" "SB-C")))
(and sym
(fboundp sym)
(funcall sym :setf :inverse ()))))))
;;; swank-mop
......@@ -960,8 +969,8 @@ QUALITIES is an alist with (quality . value)"
(or name (function-name function))))
(defun setf-expander (symbol)
(or
#+#.(cl:if (sb-c::meta-info :setf :inverse ()) '(:and) '(:or))
(or
#+#.(swank/sbcl::sbcl-with-setf-inverse-meta-info)
(sb-int:info :setf :inverse symbol)
(sb-int:info :setf :expander symbol)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment