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

edit definition



When I define a LISP structure, Zmacs "knows" that the definitions of the accessor functions,
predicate function, etc. are inside the structure definition. Now I want to define my own macro
with much of the same functionality:
	(defmacro deffoo (name)
	  (let ((predicate (intern (format nil "~a-P" name))))
	  `(progn (blah-blah-blah)
	          (defun ,predicate (x)
	            (typep x ',name))
		  ',name)))

Example: (deffoo boo-boo)
=> (PROGN (BLAH-BLAH-BLAH)
          (DEFUN BOO-BOO-P (X)
            (TYPEP X 'BOO-BOO))
          'BOO-BOO)

Defun automatically records the source file name for boo-boo-p, but Zmacs cannot find the embedded 
definition. It gives me an annoying message like "Can't find definition for BOO-BOO-P; trying textual
search." How can I get Zmacs to correctly find this embedded definition a la defstruct?

	Len Charest	charest@ai-sun.jpl.nasa.gov
	JPL AI Lab