[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

get,getf



    Date: Tue, 5 Mar 91 08:24 MST
    From: paul@taos.intel.com (Paul Collier)

    While looking through some of the system code that performs backups, I
    came across the following:

	    (dolist (elt (backup-dump-get-dir-list wildpath))
	(if (dumper-prefilter elt)
	    (if (get elt :directory)
		(push (car elt) dirs)
		(push elt files))))

    According to CLtL p. 164, and the Symbolics debugger, this shouldn't
    work. GET is defined as returning a value from the property list of a
    symbol and sure enough, if I try to run this as a function unto itself,
    it blows up because elt is bound to an element of a list. Not to mention
    that the value of elt is such that it won't work as a plist. 

This is not LISP:GET, it is ZL:GET.  The LMFS package inherits from ZL
rather than SCL.

As I'm sure many old Zetalisp hackers will tell you, ZL:GET takes either
a symbol or a "disembodied plist", which was usually a locative to a
CL-style plist or a plist with an extra CAR in front.

As an illustration, a CL equivalent might be:

(defun zl:get (symbol indicator)
  (typecase symbol
    (symbol (getf (symbol-plist symbol) indicator))
    (otherwise (getf (cdr symbol) indicator))))

 -- Chuck Fry  Chucko@Charon.ARC.NASA.GOV