aboutsummaryrefslogtreecommitdiffhomepage
path: root/definition-macros.lisp
blob: 6ecda6d94ddd5a09cd500c557b149f3b68f5f04c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
;;;; definition-macros.lisp

(in-package :vampire)

(defmacro defclass/bknr (name supers slotdefs &rest options)
  "Defines a class using defclass/std syntax. Ensures that the class
   is a sublcas of STORE-OBJECT with metaclass PERSISTENT-CLASS."
  (let* ((include-store-object-p
           (notany (lambda (c) (closer-mop:subclassp c 'store-object))
                   supers))
         (supers
           (if include-store-object-p
               `(store-object ,@supers)
               supers)))
    `(eval-when (:compile-toplevel)
       (defclass/std ,name ,supers
         ,slotdefs
         (:metaclass persistent-class)
         ,@options))))