auto doc generation
This commit is contained in:
+14
-10
@@ -2,22 +2,26 @@
|
||||
"Macro for creating simple classes."
|
||||
(let ((name (first name-and-members))
|
||||
(members (rest name-and-members)))
|
||||
`(define
|
||||
;; The function definition
|
||||
(,(string->symbol (concat-strings "make-" (symbol->string name))) @members)
|
||||
;; The docstring
|
||||
,(concat-strings "This is the handle to an object of the class " (symbol->string name))
|
||||
;; the body
|
||||
(let ,(zip members members)
|
||||
@body
|
||||
(set-type
|
||||
`(set-type
|
||||
(define
|
||||
;; The function definition
|
||||
(,(string->symbol (concat-strings "make-" (symbol->string name))) @members)
|
||||
;; The docstring
|
||||
,(concat-strings "This is the handle to an object of the class " (symbol->string name))
|
||||
;; the body
|
||||
@body
|
||||
(let ,(zip members members)
|
||||
(set-type
|
||||
(lambda (:rest args)
|
||||
"This is the docs for the handle"
|
||||
(let ((op (eval (first args))))
|
||||
(if (callable? op)
|
||||
(eval args)
|
||||
(eval (first args)))))
|
||||
,(symbol->keyword name))))))
|
||||
,(symbol->keyword name))))
|
||||
:constructor)))
|
||||
|
||||
(define-syntax (-> obj meth :rest args)
|
||||
`(,obj ',meth @args))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user