<br><div>Today I was looking at fixing some of our PRINT.* failures in the ansi test suite.</div><div><br></div><div>Hoping to get an easy start, I started looking PRINT.RANDOM-STATE.1 The problem shown by the test is that our RANDOM-STATEs are not printable. From the perspective of ABCL, that's logical: Java's Random objects are serializable, but as everywhere in Java, it's serialization is internal to the implementation. The Random object is initialized using a 'seed' long value, but there's no way to extract a 'seed' value from the object to be used to initialize an object into the same state.</div>
<div><br></div><div>So, I'm now pondering what action to take. I'm seeing several options:</div><div><br></div><div>1. build our own pseudo random number generator with its own random state</div><div>2. serialize the Random object to a byte array and use that array as some sort of printed representation (sure, we'll definitely need to look into ways to load)</div>
<div><br></div><div>The advantage of (1) is that we can create it all in Lisp, however, it's pure additional code, since we won't be leveraging what's already there.</div><div><br></div><div>The advantage of (2) is that we can use what Java maintains for us and even better: we can use the random number generator shared between Lisp and Java code. I imagine the disadvantage of this solution is that the serialization of the random state can differ between Java versions and implementations.</div>
<div><br></div><div>Any ideas??</div><div><br></div><div><br></div><div>Bye,</div><div><br></div><div><br></div><div>Erik.</div>