library_name: cl-annot

system_name: cl-annot

macro_name: export-slots

macro_definition:
(defmacro export-slots (class-definition-form)
  (progn-form-replace-last
   (lambda (class-definition-form)
     (loop for slot-specifier in (slot-specifiers class-definition-form)
           for slot = (if (consp slot-specifier)
                          (car slot-specifier)
                          slot-specifier)
           collect slot into slots
           finally
        (return
          (if slots
              `(progn
                 (export ',slots)
                 ,class-definition-form)
              class-definition-form))))
   class-definition-form))

form_type: defmacro

args: (class-definition-form)

status: extracted


macro_name: export-accessors

macro_definition:
(defmacro export-accessors (class-definition-form)
  (progn-form-replace-last
   (lambda (class-definition-form)
     (case (first class-definition-form)
       (defclass (get-accessors-in-defclass class-definition-form))
       (defstruct (get-accessors-in-defstruct class-definition-form))))
   class-definition-form))


macro_name: export-constructors

macro_definition:
(defmacro export-constructors (class-definition-form)
  (progn-form-replace-last
   (lambda (class-definition-form)
     (case (first class-definition-form)
       (defstruct
           (if (consp (second class-definition-form))
               (let ((constructor-clauses
                      (remove-if-not
                       (lambda (lst) (eq (first lst) :constructor))
                       (mapcar #'ensure-list
                               (cdr (second class-definition-form))))))
                 (if (and (= 1 (length constructor-clauses))
                          (= 2 (length (car constructor-clauses)))
                          (null (cadar constructor-clauses)))
                     class-definition-form
                     `(progn
                        (export
                         ',(or (remove nil (mapcar #'second constructor-clauses))
                               (list (symbolicate
                                      'make- (first (second class-definition-form))))))
                        ,class-definition-form)))
               `(progn
                  (export
                   '(,(symbolicate
                       'make- (second class-definition-form))))
                  ,class-definition-form)))
       (t class-definition-form)))
   class-definition-form))


macro_name: export-class

macro_definition:
(defmacro export-class (class-definition-form)
  `(annot.std:export*
    (export-slots
     (export-accessors
      ,class-definition-form))))


macro_name: export-structure

macro_definition:
(defmacro export-structure (class-definition-form)
  `(annot.std:export*
    (export-slots
     (export-accessors
      (export-constructors
       ,class-definition-form)))))


macro_name: eval-when-compile

macro_definition:
(defmacro eval-when-compile (&body body)
  `(eval-when (:compile-toplevel) ,@body))

args: (&body body)


macro_name: eval-when-load

macro_definition:
(defmacro eval-when-load (&body body)
  `(eval-when (:load-toplevel) ,@body))


macro_name: eval-when-execute

macro_definition:
(defmacro eval-when-execute (&body body)
  `(eval-when (:execute) ,@body))


macro_name: eval-always

macro_definition:
(defmacro eval-always (&body body)
  `(eval-when (:compile-toplevel :load-toplevel :execute) ,@body))


macro_name: def-slot-annotation

macro_definition:
(defmacro def-slot-annotation (name args &body body)
  (with-gensyms (slot-specifier)
    `(defannotation ,name ,(append args (list slot-specifier))
         (:inline t :arity ,(1+ (length args)))
       (destructuring-bind (slot-name . slot-options)
           (if (consp ,slot-specifier)
               ,slot-specifier
               (list ,slot-specifier))
         ,@body
         (cons slot-name slot-options)))))

args: (name args &body body)


macro_name: %annotation

macro_definition:
(defmacro %annotation (annot &rest args)
  "Annotation Expansion Engine."
  (expand-annotation annot args))

docstring: Annotation Expansion Engine.

args: (annot &rest args)


macro_name: defannotation

macro_definition:
(defmacro defannotation (name lambda-list options &body body)
  `(progn
     (set-annotation-options ',name ',options)
     (defmacro ,name ,lambda-list ,@body)))

args: (name lambda-list options &body body)


macro_name: enable-annot-syntax

macro_definition:
(defmacro enable-annot-syntax ()
  '(eval-when (:compile-toplevel :load-toplevel :execute)
    (%enable-annot-syntax)))


macro_name: id-macro

macro_definition: (defmacro id-macro (x) x)


macro_name: fun

macro_definition: (defmacro fun () `(defun f ()))


macro_name: mac

macro_definition: (defmacro mac () 1)