Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Lisp Meta-Info

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.

Name: Anonymous 2014-08-20 22:25

its

Name: Anonymous 2014-08-21 9:31

Forget it, it's NP complete.

Name: Anonymous 2014-08-21 15:35

>>3

Your brain is unfit to think.

Name: Anonymous 2014-08-21 15:38

Just use Haskell.

Name: Anonymous 2014-08-21 17:09

>>5

implement meta-circular evaluator in Haskell.

Name: Anonymous 2014-08-21 19:38

>>6
why would you want to do that?

Name: Anonymous 2014-08-21 19:56

>>7

why wouldn't you want to do that?

Name: Anonymous 2014-08-22 4:02

common lisp has it.

* (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"

Name: Anonymous 2014-08-22 9:10

There is no standard way to attach that info to your function. You normally write a header that explains the important points of your function.

Name: Anonymous 2014-08-22 9:43

>>9

how defun implements it?

Name: Anonymous 2014-08-22 9:46

>>11
`>11
>dubs

nice :^)

Name: Anonymous 2014-08-22 12:47

>>11
it's part of CLOS you shitlord

Name: Anonymous 2014-08-25 6:50

>>11
You could implement a documentation system like so.

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

Don't change these.
Name: Email:
Entire Thread Thread List