Changeset 13011


Ignore:
Timestamp:
Oct 13, 2009, 9:41:49 PM (10 years ago)
Author:
rme
Message:

If WATCH is passed an array, hash-table, or standard-instance, watch
the underlying data-vector, hash-table-vector, or slot-vector,
respectively.

New function PRIMITIVE-WATCH.

File:
1 edited

Legend:

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

    r13007 r13011  
    10571057      (%map-areas #'(lambda (x) (push x result)) area-watched area-watched))
    10581058    result))
    1059    
     1059
     1060(defun primitive-watch (thing)
     1061  (require-type thing '(or cons (satisfies uvectorp)))
     1062  (%watch thing))
     1063
    10601064(defun watch (&optional thing)
    1061   (if thing
    1062     (progn
    1063       (require-type thing '(or cons (satisfies uvectorp)))
    1064       (%watch thing))
    1065     (all-watched-objects)))
     1065  (cond ((null thing)
     1066         (all-watched-objects))
     1067        ((arrayp thing)
     1068         (primitive-watch (array-data-and-offset thing)))
     1069        ((hash-table-p thing)
     1070         (primitive-watch (nhash.vector thing)))
     1071        ((standard-instance-p thing)
     1072         (primitive-watch (instance-slots thing)))
     1073        (t
     1074         (primitive-watch thing))))
    10661075
    10671076(defun unwatch (thing)
Note: See TracChangeset for help on using the changeset viewer.