Simple Frame Program

Slots are stored on the property list of a symbol as an alist of facets, e.g. ((value 4)) .

(defun getslot (frame slot-name)
  (getslotb frame frame slot-name))

(defun getslotb (orig-frame frame slot-name)
  (let (slot if-needed)
    (if (setq slot (get frame slot-name))
        (or (cadr (assoc 'value slot))
            (if (setq if-needed
                      (assoc 'if-needed slot))
                (funcall (cadr if-needed)
        (some #'(lambda (super)
                  (getslotb orig-frame super
              (get frame 'supers)))))

A stored value is used if available; else an if-needed method is called if available; else an attempt is made to get the value from one of the supers.

Contents    Page-10    Prev    Next    Page+10    Index