Changeset 15523


Ignore:
Timestamp:
Dec 4, 2012, 8:06:13 PM (7 years ago)
Author:
svspire
Message:

Make unadvise work the way its documentation claims.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/encapsulate.lisp

    r14371 r15523  
    196196
    197197
    198 (defun encapsulate (owner newdef type trace-spec newsym &optional advice-name advice-when)
     198(defun encapsulate (owner newdef type spec newsym &optional advice-name advice-when)
    199199  (let ((cap (make-encapsulation
    200200              :owner owner
    201201              :symbol newsym
    202202              :type type
    203               :spec trace-spec
     203              :spec spec
    204204              :advice-name advice-name
    205205              :advice-when advice-when)))
     
    832832  (cond ((neq function t)
    833833         `(%unadvise-1 ',function ',when ',name))
    834         (t '(%unadvise-all))))
    835 
    836 (defun %unadvise-all ()
     834        (t `(%unadvise-all ',when ',name))))
     835
     836(defun %unadvise-all (&optional when name)
    837837  (loop for cap being the hash-value of *encapsulation-table*
    838     when (eq (encapsulation-type cap) 'advice)
     838    when (and (eq (encapsulation-type cap) 'advice)
     839              (or (null when)(eq when (encapsulation-advice-when cap)))
     840              (or (null name)(equal name (encapsulation-advice-name cap))))
    839841    collect (progn
    840842              (remove-encapsulation cap)
Note: See TracChangeset for help on using the changeset viewer.