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

edit definition

    Date: Fri, 15 Jun 90 11:46 PDT
    From: Len Charest <Charest@ai-sun.jpl.nasa.gov>

    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))

1;;; Controls how it appears in the echo area when doing m-., for example.
(setf (get 'deffoo 'si:definition-type-name) "Deffoo")

0(defmacro deffoo (name)
  (let ((predicate (intern (format nil "~a-P" name))))
    `(progn (blah-blah-blah)
	    (defun ,predicate (x)
1	      (declare (sys:function-parent ,name deffoo))
0	      (typep x ',name))

You might also want to do:

1(setf (get 'deffoo 'zwei:definition-function-spec-type) 'defun)

0if you want these definitions to be essentially considered function
definitions.  (1defmacro0 does this, for example).  If so, replace
the 1deffoo0 above in the declaration with 1defun0.

1sys:function-parent0 is documented.