[CM] pval in markov

todd ingalls testcase@asu.edu
Mon, 14 Mar 2005 16:45:03 -0700


Hi.

Was wondering if perhaps I am misunderstanding something about pval.

The following works -

   (setf x (new random :of `((50 weight ,(pval (between .1 .2))) (51 
weight ,(pval (between .8 1.0))))))
   (next x 20)
   => (51 51 51 51 51 50 50 50 51 51 51 51 51 51 51 51 50 51 51 51)

but the following does not in a markov pattern

   (setf x (new markov :of `((50 -> (51 ,(pval (between .2 1.0))) (50 
.1))
			  (51 -> (50 ,(pval (between .2 1.0))) (51 .1)))))

   => value #<PVAL #x675E5FE> is not of the expected type NUMBER.
      [Condition of type TYPE-ERROR]	


Now, the following does work:

(setf x (new markov :of `((50 -> (51 ,(funcall (pval-thunk (pval 
(between .2 1.0))))) (50 .1))
			  (51 -> (50 ,(funcall (pval-thunk (pval (between .2 1.0))))) (51 
.1)))))

(next x 20)
=> (50 51 50 51 50 51 50 51 50 51 51 50 51 51 51 50 51 50 51 50)


is there a less verbose way to use pval in a markov pattern?