Name: Anonymous 2014-08-20 21:36
What is the standard way to attach meta-info to Scheme or Common Lisp object? Like a textual description to a function or it's source code.
* (defun defile (defiler defilee)
"Defiler will defile the defilee"
(assert (eq (get-gender defiler) :male))
(let ((defilee-body-part (case (get-gender defilee)
((:female (get-vagina defilee)))
((:male (get-anus defilee)))
(t (error "cannot defile"))))
(penis (get-penis defiler)))
(insert-body-part penis defilee-body-part)
(oscillate-body-part penis)
(let ((ejaculate (ejaculate penis)))
(absorb (defilee-body-part ejaculate)))
(enjoy-contentment defiler)
(remove-body-part penis defilee-body-part)))
* (documentation 'defile 'function)
"Defiler will defile the defilee"
(defvar *secret-defun-documentation-table* (make-hash-table))
(defmacro awesome-defun (func-name args &rest body)
(assert (listp args))
(assert (symbolp func-name))
(if (or (null body)
(not (stringp (car body))))
`(defun ,func-name ,args ,@body)
(let ((docu (car body))
(real-body (cdr body)))
(setf (gethash func-name *secret-defun-documentation-table*) docu)
`(defun ,func-name ,args ,@body))))
(defun awesome-documentation (func-name)
(gethash func-name *secret-defun-documentation-table*))
;; example
(awesome-defun f1 (x)
"Prints x times 3"
(print (* x 3)))
(print (awesome-documentation 'f1))