complex-test: generate-instances generates instance from each class
Mon Oct 19 06:29:09 PDT 2009 tomi.borbely@gmail.com
* complex-test: generate-instances generates instance from each class
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/test/dimensional/complex.lisp new-cl-perec/test/dimensional/complex.lisp
--- old-cl-perec/test/dimensional/complex.lisp 2014-04-19 23:05:17.000000000 -0700
+++ new-cl-perec/test/dimensional/complex.lisp 2014-04-19 23:05:17.000000000 -0700
@@ -443,8 +443,11 @@
available-slot-names)))
(def function generate-instances (class-names count &key (slot-names nil))
- (iter (repeat count)
- (for class-name = (random-elt class-names))
+ (iter (with class-count = (length class-names))
+ (for i :from 0 :below count)
+ (for class-name = (if (< i class-count)
+ (elt class-names i)
+ (random-elt class-names)))
(for instance = (make-instance* class-name :slot-names slot-names))
(format t "Generated instance ~A~%" instance)
(collect instance)))