auto doc generation

This commit is contained in:
Felix Brendel
2019-06-11 01:17:36 +02:00
parent d01269aa13
commit 6f5ecc87b0
22 changed files with 2375 additions and 229 deletions
+14 -10
View File
@@ -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))