Update of /project/rjain-utils/cvsroot/formulate/examples
In directory cl-net:/tmp/cvs-serv29200/examples
Modified Files:
simple.lisp
Log Message:
Refactor a bit and get everything working for the basic lazy evaluation
and unconditional propagation scenario.
--- /project/rjain-utils/cvsroot/formulate/examples/simple.lisp 2007/11/02 20:45:39 1.1.1.1
+++ /project/rjain-utils/cvsroot/formulate/examples/simple.lisp 2009/11/04 21:41:34 1.2
@@ -1,5 +1,19 @@
(in-package :formulate-user)
+(define-formulated-variable *x* 5
+ :formulator-class simple-formulator-source)
+
+(define-formulated-variable *y* (expt *x* 2))
+
+(assert (= *x* 5))
+
+(assert (= *y* 25))
+
+(setf *x* 2)
+
+(assert (= *y* 4))
+
+
(defgeneric area (shape))
(defgeneric perimeter (shape))
@@ -26,4 +40,3 @@
(setf (circle-radius circle) i)
(format t "~&A circle with radius ~A has perimeter ~A and area ~A~%"
(circle-radius circle) (perimeter circle) (area circle))))
-