swissChili | 8b5ec7a | 2022-08-05 22:26:17 -0700 | [diff] [blame] | 1 | ;;; oop.lisp |
2 | |||||
3 | ;; TODO | ||||
4 | (defmacro defclass (name members) | ||||
5 | "(defclass person (name age (occupation nil)))" | ||||
6 | (let ((makefn-name (string->symbol (concat "make-" (symbol->string name)))) | ||||
7 | (class-sym (gensym)) | ||||
8 | (nmemb (length members))) | ||||
9 | `(defun ,makefn-name ,members | ||||
10 | (let ((,class-sym (make-class ,name ,nmemb))) | ||||
11 | ,class-sym)))) |