Frank Goenninger wrote:
Hi Frank,
(wow - another Cells user in Germany ;-) - We're three now)
Heh.
As Kenny and Jakub have suggested one common solution I find myself using from time to time is:
(defmd frgo () (entered-value (c-in nil)) (value (c? (or (^entered-value) (computed-value)))))
(defun computed-value () ;;; Just making a simple function that fakes a computed value 'computed)
(defun test-it () (let ((self (make-instance 'frgo))) (format t "~&Entered value: ~s~%" (^entered-value)) (format t "~&Value: ~s~%" (^value))
(setf (^entered-value) 'entered) (format t "~&Entered value: ~s~%" (^entered-value)) (format t "~&Value: ~s~%" (^value))))
That looks very good. When used with ":reader value" for the value slot and ":writer value" for the entered-value slot this works very well.
Thanks a lot!
Cheers, Bastian