When I run a select-dao, the REPL prints a bunch of warnings like:
Warning: (METHOD UPDATE-DAO (CPA-SERIES)) defined more than once in d:\lisp\postmodern\postmodern\table.lisp.
Is this something I can fix? Thanks for any help.
Mitch
Is there anything that might be causing the class to be finalised multiple times? (Multiple defclass forms, or a redefinition of a parent class...) These methods get defined every time the class is finalised.
Marijn Haverbeke wrote:
Is there anything that might be causing the class to be finalised multiple times? (Multiple defclass forms, or a redefinition of a parent class...) These methods get defined every time the class is finalised.
I don't know. Maybe I am not using the :metaclass correctly. I have classes in a file as in this example:
(defclass cpa-email () ((id :col-type integer :accessor email-id) (member_id :col-type integer :accessor email-member)) (:metaclass postmodern:dao-class) (:keys id) (:table-name db_email))
(defclass cpa-phone () ((id :col-type integer :accessor phone-id) (member :col-type integer :accessor phone-member) (description :col-type string :accessor phone-description)) (:metaclass postmodern:dao-class) (:keys id) (:table-name db_phone))
When I compile this, I get the warnings: ;;;*** Warning in (DEFCLASS CPA-EMAIL): (METHOD GET-DAO ((EQL (CLASS-NAME CLASS)))) defined more than once in d:\lisp\postmodern\postmodern\table.lisp. ;;;*** Warning in (DEFCLASS CPA-PHONE): (METHOD GET-DAO ((EQL (CLASS-NAME CLASS)))) defined more than once in d:\lisp\postmodern\postmodern\table.lisp.
Mitch
Which CL implementation is this?
Which CL implementation is this?
Lispworks 5.1 on XP.
Hm, I haven't tested on Lispworks in a long time. What I suspect is happening is that it has a slightly dumb redefinition check -- what's happening is that defmethod is being called from a function (for every finalised dao class), with an (eql class) specialiser where class is a lexically scoped variable. Most lisps seem to realise that class is bound to something new every time the function is called, and don't complain.
This should be harmless. If it is causing problems (warnings at inappropriate times), could you find the Lispworks-specific magic-wrapper that can disable these warnings (if there is such a thing) and provide a patch where the relevant defmethod calls (function build-dao-methods in postmodern/table.lisp) get conditionally wrapped by such a thing on Lispworks?
Best, Marijn
postmodern-devel@common-lisp.net