Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to couple it with another metaclass, like Mito's dao-table-class ? #8

Open
vindarel opened this issue Jul 9, 2019 · 0 comments

Comments

@vindarel
Copy link

commented Jul 9, 2019

Your recent achievement opens more possibilities. It would be awesome to couple sanity-clause's metaclass with Mito's dao-table-class.

However, a class can accept only one metaclass, and a quick test by creating two classes one after the other shows conflicts:

(defclass mito-class (standard-class)
        ()
        (:metaclass mito:dao-table-class))
#<MITO.DAO.TABLE:DAO-TABLE-CLASS COMMON-LISP-USER::MITO-CLASS>
CL-USER> (defclass sanity-mito-class (mito-class)
        ()
        (:metaclass sanity-clause.metaclass:validated-metaclass))
#<SANITY-CLAUSE.METACLASS:VALIDATED-METACLASS COMMON-LISP-USER::SANITY-MITO-CLASS>
CL-USER> (defclass person ()
((name
    :initarg :name
    :accessor name)
(age 
    :initarg :age
    :accessor age
    :type (integer 0)
    :required t))
(:metaclass sanity-mito-class))


There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION SANITY-CLAUSE.METACLASS::FIELD-OF (1)>
when called with arguments
  (#<MITO.DAO.COLUMN:DAO-TABLE-COLUMN-CLASS MITO.DAO.MIXIN::CREATED-AT>).

It would be awesome to work around this.

cc @svetlyak40wt

origin: https://www.reddit.com/r/Common_Lisp/comments/ca441r/fisxojsanityclause_a_data_serializationcontract/etb9ey2/

@fisxoj fisxoj self-assigned this Aug 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.