(ql:quickload :postmodern)
(defpackage :test-case
(:use :cl)
(:import :pomo))
(in-package :test-case)
;; (defclass dao-class (standard-class)
;; ((direct-keys :initarg :keys :initform nil :reader direct-keys)
;; (effective-keys :reader dao-keys)
;; (table-name)
;; (column-map :reader dao-column-map))
;; (:documentation "Metaclass for database-access-object classes."))
(defclass definition ()
((id :col-type serial :reader definition-id)
(content :col-type string :initarg :content :accessor definition-content)
(word :col-type string :initarg :word :accessor definition-word))
(:metaclass dao-class)
(:keys id))
(pomo:dao-keys 'definition)
;; => (ID)
;; What I am setting with :keys? a slot in the meta class?
答案 0 :(得分:3)
dao-class
有direct-keys
个广告位,其:initarg
的名称为:keys
,因此,如果我正确理解您的问题,答案是:“是的,{{1提供元类(:keys id)
中direct-keys
广告位的值。“
编辑更准确地说,这里,由于措辞不太清楚...... dao-class
是一个元类,即一个类,其实例本身就是类。在这种情况下,类 dao-class
是definition
的实例,其中包含插槽dao-class
(在{{1}中声明}}),direct-keys
中该插槽的值是通过dao-class
选项提供的值初始化的。