[Cuis-dev] Fix for TimeAndDate>>nanosecondsTick

Luciano Notarfrancesco luchiano at gmail.com
Sun Jan 11 11:37:17 PST 2026


This fixes a bug in TimeAndDate class>>updateLastTickAndOffset and changes
Random class>>new to call TimeAndDate nanosecondsTick instead of Time
milisecondClockValue, so that if you create two random generators
successively they will not have the same seed. Let me know what you think,
maybe there is a cleaner alternative (perhaps generating the seed from the
existing DefaultInstance if it is not nil).

BTW, the bug is pretty obvious when you see the diff, but just in case you
can test with:
((1 to: 100) collect: [:x| DateAndTime nanosecondsTick]) asSet size
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260112/fd085b46/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateAndTime#class-updateLastTickAndOffset.st
Type: application/octet-stream
Size: 748 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260112/fd085b46/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Random#class-new.st
Type: application/octet-stream
Size: 203 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260112/fd085b46/attachment-0003.obj>


More information about the Cuis-dev mailing list