I would like to randomly pick a nested list. That works in principle, but the nesting is lost.
(rnd-pick '(((h q) (h))
((h. q) (h))
((h. h) (h))))
=> ((3/4 1/4) (1/2)) ; instead returns (3/4 1/4 1/2)
I guess I have to roll my own :)
(defun rnd-pick2 (selections &key (prob 0.5) seed)
"Randomly selects a value from `selections' (without transforming that value).
Very similar to rnd-pick, but leaves selected value unchanged (e.g., unflattened).
Args
I would like to randomly pick a nested list. That works in principle, but the nesting is lost.
(rnd-pick '(((h q) (h))
((h. q) (h))
((h. h) (h))))
=> ((3/4 1/4) (1/2)) ; instead returns (3/4 1/4 1/2)
I guess I have to roll my own :)
(defun rnd-pick2 (selections &key (prob 0.5) seed)
"Randomly selects a value from `selections' (without transforming that value).
Very similar to rnd-pick, but leaves selected value unchanged (e.g., unflattened).
Args