fix: checking the result with debug-query-compiler
Mon Oct 19 06:27:07 PDT 2009 tomi.borbely@gmail.com
* fix: checking the result with debug-query-compiler
Warning: CRC errors found. These are probably harmless but should be repaired.
See 'darcs gzcrcs --help' for more information.
diff -rN -u old-cl-perec/query/compiler.lisp new-cl-perec/query/compiler.lisp
--- old-cl-perec/query/compiler.lisp 2014-07-31 12:38:05.000000000 -0700
+++ new-cl-perec/query/compiler.lisp 2014-07-31 12:38:05.000000000 -0700
@@ -147,12 +147,11 @@
;; TODO: set-exclusive-or is not ok for comparing the results, because
;; the result is not a set and (set-exclusive-or '(a b b) '(a a b))
;; returns NIL.
- (when (set-exclusive-or ,result-list ,expected-list :test 'equal)
+ (when (set-exclusive-or ,result-list ,expected-list :test 'generic-equal)
(cerror "Return the expected result." 'query-result-mismatch-error
:query ,query :result ,result-list :expected ,expected-list))
,expected))))))
-
;;;;---------------------------------------------------------------------------
;;;; Simple query compiler
;;;;
diff -rN -u old-cl-perec/util/duplicates.lisp new-cl-perec/util/duplicates.lisp
--- old-cl-perec/util/duplicates.lisp 2014-07-31 12:38:05.000000000 -0700
+++ new-cl-perec/util/duplicates.lisp 2014-07-31 12:38:05.000000000 -0700
@@ -355,4 +355,12 @@
(apply #'every predicate first-sequence other-sequences))))
(defmacro swap (place-1 place-2)
- `(rotatef ,place-1 ,place-2))
\ No newline at end of file
+ `(rotatef ,place-1 ,place-2))
+
+(defgeneric generic-equal (left right)
+ (:method (left right)
+ (equal left right))
+ (:method ((left timestamp) (right timestamp))
+ (timestamp= left right))
+ (:method ((left sequence) (right sequence))
+ (every* #'generic-equal left right)))
\ No newline at end of file