[CM] CM random seed

Joshua Parmenter joshp at u.washington.edu
Sat May 21 12:38:58 PDT 2005


Thanks Rick.

I was starting to get to that understanding myself as I've been  
working on it this morning. A few minutes ago I realized that there  
were different openmcl versions used in the os x binary dists. I  
think CM 2.4 was using 0.14.1, and now it looks like 0.14.3 is being  
used... sorry for the trouble... Thanks for you help!

Josh


******************************************
Joshua D. Parmenter
http://homepage.mac.com/joshpar/

"...Some people think a composer's supposed to please them, but in a  
way a composer is a chronicler... He's supposed to report on what  
he's seen and lived."
                                                                         
      -Charles Mingus

On May 21, 2005, at 12:27 PM, Rick Taube wrote:

> On May 21, 2005, at 11:23 AM, Joshua Parmenter wrote:
>
>
>> Thanks Rick, that works.
>> But how can I change the seeded value?  Or save one (other then  
>> the one generated by nil) for later use (possibly in another  
>> session) if the printed one can't be manipulated? I know this will  
>> be different for different lisps, but I am more concerned with  
>> personal use, and I was able to do this not long ago (in CM 2.4).  
>> Now that code is broken, and I want to try and find a way to fix it.
>> Josh
>>
>
> CL deliberately  does not provide a way to seed random states.  but  
> most implemenations probably have some mechanism -- in openmcl its  
> ccl::initialize-random-state. this is what ccl does in l1- 
> numbers.lisp :
>
> (defparameter *random-state* (initialize-random-state #xFBF1 9))
>
> as far as saving random-states go, you should be able to print them  
> to a file and read them back in. Most Lisps print random states  
> using the #S read macro for just this reason -- i dont know why ccl  
> uses #. since random-state cannot be a function.
>
> I guess you could redefine the print-object method  for random  
> states to print like this:
>
>     #.(ccl::initialize-random-state nnn nnn)
>
> anyway cm has nothing to do with this stuff, its up to the  
> underlying lisp to provide something (or not). if it worked in cm  
> 2.4 then it was probably only because ccl was letting you do  
> something that it no longer allows.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20050521/528b3fbc/attachment.html>


More information about the Cmdist mailing list