On Thu, Feb 18, 2021 at 05:46:40AM -0800, Ralf Hemmecke wrote:
> Hello,
> 
> this continues a thread 
> https://groups.google.com/g/fricas-devel/c/zSamEbPXRwQ/m/TmHfWltgBAAJ
> that I started in 2019 and is connected to this thread about random numbers.
> https://groups.google.com/g/fricas-devel/c/C2YxwxnnSMs/m/DKkMJKWTBAAJ
> 
> I could now use Qian's suggestion
> 
> )lisp (setf *random-state* (make-random-state t)) 
> 
> since in my case I can simply pipe that command in with every new start 
> of FriCAS (like in FRICAS_INIT).
> 
> However, since random$Integer is, in fact, just calling Lisp, it would be 
> nice to
> add a function
> 
> seedRandom(): Void == SEED_-RANDOM()$Lisp
> 
> to integer.spad and si.spad or simply into the category IntegerNumberSystem
> 
> with an implementation
> 
> (defun seed-random () (setf *random-state* (make-random-state t)))
> 
> in vmlisp.lisp or somewhere else.
> 
> As far as I understand the documentation of (make-random-state t), it gets 
> its
> randomness from/dev/urandom or time+pid if possible. Both would be good 
> enough
> for my case and even if it does not help on some weird systems, it should 
> certainly
> be a bit better than having no random source at all.
> 
> What's your opinion? 
> Waldek would you include such code? If yes, where?

We can include it.  I would call Lisp function SEED_RANDOM, so
that exactly the same sequence of characters is used as Spad
and Lisp name.  I think that proper place for it is in 'primitives.lisp'
('vmlisp.lisp' is for legacy things).

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20210218180126.GC12410%40math.uni.wroc.pl.

Reply via email to