X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=ecmalisp.lisp;h=bf4810b5111f6474c8bf22bd5debff9112b23a23;hb=b500e8a044b964db4baff9e387d0ddd1748eb690;hp=8d5bac59244be1124f7eb611776f28309c28ccb8;hpb=272e59575ed76512eb43e3f2361af4a36ecd4eed;p=jscl.git diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 8d5bac5..bf4810b 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -386,7 +386,7 @@ ;; A very simple defstruct built on lists. It supports just slot with ;; an optional default initform, and it will create a constructor, ;; predicate and accessors for you. - (defmacro !defstruct (name &rest slots) + (defmacro defstruct (name &rest slots) (unless (symbolp name) (error "It is not a full defstruct implementation.")) (let* ((name-string (symbol-name name)) @@ -408,6 +408,9 @@ ;; Predicate (defun ,predicate (x) (and (consp x) (eq (car x) ',name))) + ;; Copier + (defun ,(intern (concat "COPY-" name-string)) (x) + (copy-list x)) ;; Slot accessors ,@(with-collect (let ((index 1))