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

Re: IWMC-Class-p bug & make-specializable



	The example that blew up in my face:
		(IWMC-Class-p #<Some font>)

	The original code:
(scl:defsubst iwmc-class-p (x)
  (and (si:arrayp x)
       (not (zerop (si:array-named-structure-bit x)))
       (eq (aref x 0) 'iwmc-class)))

	I Gather that fonts are arrays (multi-dimensional), are named
structures (unsuprisingly) and have an array leader - in which case the
named-structure-symbol is stored in element 1 of the LEADER rather than
in element 0 of the array itself... a normal multi-d array gets caught
before the aref happens, and a regular structure is single-dimensional.

	Our fix (which works) was:
(scl:defsubst iwmc-class-p (x)
  (and (si:arrayp x)
       (not (zerop (si:array-named-structure-bit x)))
       (eq (array-dimensions x) 1)
       (eq (aref x 0) 'iwmc-class)))

	But the following should (?) also work, and possibly faster:
(scl:defsubst iwmc-class-p (x)
  (and (named-structure-p x)
       (eq (named-structure-symbol x) 'iwmc-class)))


As to my comment about FINs - again, another case of inaccuracy in my
original message... Attempting to print the environment of a *FIN* (as in
describe-ing a FIN) results in an infinite printed representation, since
the tail of the env list is a pair whose first element is the whole list
whose tail is a pair whose first element is the whole list whose tail...
Solution? Disconnect the env from the closure (can the system be tricked
into thinking that the list is shorted than it actually is?)? 

	cheers,
		mike (mthome@bbn.com)