The last git version of postmodern doesn't compile on SBCL 1.0.47 because there are declaration order issues in postmodern/table.lisp.
The following patch fixes these problems:
>From 7dcbd46612d97af758408f66b2b18e48f3814b78 Mon Sep 17 00:00:00 2001 From: Nicolas Martyanoff <khae...@gmail.com> Date: Mon, 25 Apr 2011 00:35:45 +0200 Subject: [PATCH 2/2] fix declaration order to make postmodern compile --- postmodern/table.lisp | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/postmodern/table.lisp b/postmodern/table.lisp index db119a0..1d2fd8a 100644 --- a/postmodern/table.lisp +++ b/postmodern/table.lisp @@ -1,5 +1,12 @@ (in-package :postmodern) +(defparameter *direct-column-slot* nil + "This is used to communicate the fact that a slot is a column to + effective-slot-definition-class.") + +(defclass effective-column-slot (standard-effective-slot-definition) + ((direct-slot :initform *direct-column-slot* :reader slot-column))) + (defclass dao-class (standard-class) ((direct-keys :initarg :keys :initform nil :reader direct-keys) (effective-keys :reader dao-keys) @@ -68,7 +75,6 @@ (error "Class ~A has a key that is not also a slot." (class-name class))) (build-dao-methods class)) - (defclass direct-column-slot (standard-direct-slot-definition) ((col-type :initarg :col-type :reader column-type) (col-default :initarg :col-default :reader column-default) @@ -91,13 +97,6 @@ (find-class 'direct-column-slot) (call-next-method))) -(defparameter *direct-column-slot* nil - "This is used to communicate the fact that a slot is a column to - effective-slot-definition-class.") - -(defclass effective-column-slot (standard-effective-slot-definition) - ((direct-slot :initform *direct-column-slot* :reader slot-column))) - (defmethod compute-effective-slot-definition ((class dao-class) name direct-slot-definitions) (declare (ignore name)) (flet ((is-column (slot) (typep slot 'direct-column-slot))) @@ -146,7 +145,7 @@ (defmacro define-dao-finalization (((dao-name class) &rest keyword-args) &body body) (let ((args-name (gensym))) - `(defmethod make-dao :around ((class (eql ',class)) + `(defmethod make-dao :around ((class (eql ',class)) &rest ,args-name &key ,@keyword-args &allow-other-keys) (declare (ignorable ,args-name)) @@ -197,7 +196,7 @@ values.)" (defmethod dao-exists-p ((object target-class)) (and (every (lambda (s) (slot-boundp object s)) key-fields) (query (apply tmpl (slot-values object key-fields)) :single)))) - + ;; When all values are primary keys, updating makes no sense. (when value-fields (let ((tmpl (sql-template `(:update ,table-name :set ,@(set-fields value-fields) @@ -206,11 +205,11 @@ values.)" (when (zerop (execute (apply tmpl (slot-values object value-fields key-fields)))) (error "Updated row does not exist.")) object))) - + (let ((tmpl (sql-template `(:delete-from ,table-name :where ,(test-fields key-fields))))) (defmethod delete-dao ((object target-class)) (execute (apply tmpl (slot-values object key-fields))))) - + (let ((tmpl (sql-template `(:select * :from ,table-name :where ,(test-fields key-fields))))) (defmethod get-dao ((type (eql (class-name class))) &rest keys) (car (exec-query *database* (apply tmpl keys) (dao-row-reader class)))))) -- 1.7.4.4
Best regards, -- Nicolas Martyanoff http://codemore.org khae...@gmail.com
_______________________________________________ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel