diff --git a/csys.lisp b/csys.lisp new file mode 100644 index 0000000..c94b255 --- /dev/null +++ b/csys.lisp @@ -0,0 +1,10 @@ +;;;; decons/csys - cybernetic communication systems + +(defpackage :decons/csys + (:use :common-lisp) + (:local-nicknames (:util :scopes/util)) + (:export #:system)) + +(in-package :decons/csys) + + diff --git a/decons.asd b/decons.asd index 9029878..f6892f3 100644 --- a/decons.asd +++ b/decons.asd @@ -18,4 +18,4 @@ :depends-on (:decons) :components ((:file "test-decons")) :perform (test-op (o c) - (symbol-call :test-decons :run))) + (symbol-call :decons/test-decons :run))) diff --git a/test-decons.lisp b/test-decons.lisp index ab37734..c21e419 100644 --- a/test-decons.lisp +++ b/test-decons.lisp @@ -1,6 +1,6 @@ ;;;; decons/test-decons - basic tests. -(defpackage :test-decons +(defpackage :decons/test-decons (:use :common-lisp) (:local-nicknames (:mlx :decons/mlx) (:r :decons/recurse) @@ -9,19 +9,17 @@ (:export #:run) (:import-from :scopes/testing #:deftest #:== #:!=)) -(in-package :test-decons) +(in-package :decons/test-decons) (defun run () (let ((t:*test-suite* (t:test-suite "decons"))) - (test-basic) - (test-tensor) - (test-rcall) - (test-rreduce) + (test-xplore) + (test-recursive) (test-line) (test-quad) (t:show-result))) -(deftest test-basic () +(deftest test-xplore () (== xplore:+pi+ 3.14159) (let ((c (make-instance 'xplore:circle :radius 2.0))) (== (xplore:area c) 12.56636)) @@ -29,9 +27,6 @@ (== (xplore:absv 7) 7) (== (xplore:absv -7) 7) (== (xplore:remainder 7 4) 3) -) - -(deftest test-tensor () (== (xplore:scalar-p 7) t) (== (xplore:scalar-p '(a b)) nil) (let ((t1 (xplore:tensor '(4) '(0 1 2 3)))) @@ -41,20 +36,16 @@ (== (xplore:scalar-p t1) nil) )) -(deftest test-rcall () +(deftest test-recursive () + (== (r:reduce-all #'+ '(1 2 (3 4))) 10) + (== (r:reduce-1 #'+ '(1 2 (3 4))) '(1 2 7)) (== (r:call #'1+ 7) 8) (== (r:call #'1+ '(2 3)) '(3 4)) (== (r:add 2 3) 5) (== (r:add 3 '(4 5)) '(7 8)) (== (r:add '(2 3) '(4 5)) '(6 8)) ; not '((6 7) (7 8)) (== (r:sub '(6 7) '(4 5)) '(2 2)) ; not '((2 3) (1 2)) - (== (r:sqr '(2 3 4)) '(4 9 16)) -) - -(deftest test-rreduce () - (== (r:reduce-all #'+ '(1 2 (3 4))) 10) - (== (r:reduce-1 #'+ '(1 2 (3 4))) '(1 2 7)) -) + (== (r:sqr '(2 3 4)) '(4 9 16))) (defvar *ds1* '((2.0 1.0 4.0 3.0) (1.8 1.2 4.2 3.3)))