Ralf Hemmecke
> 
> Anyway, it would be nice to have add function that initializes the seed
> by some truely random value. Currently I see no source to get such a
> random value (except calling Lisp directly -- which I want to avoid in
> my code).

Well, trurly random value is hard to get, on Linux resonably good
approximation is '/dev/uradom' ('/dev/random' may be better, but
it blocks when it has too little randomness).  OTOH trurly
random values have little use outside cryptography.  For
most uses psuedorandom number are good enough, and to ease
debugging we want them to be repeatable.

Of course, it would be good to have some way of getting
nonrepratable numbers.  Old school used current time to
seed generator -- not very random, but nonrepratable
enough for many purposes.  Anyway, lack of such functions
is partially oversight, partially because doing it right
is hard.

BTW.  For somewhat unique file name it is usual to use
process id -- in Unix each process have unique id so
no chance of clash with another process running simultaneousy
on the same machine.  There is also special C library
function for generating temporary files: it tries somewhat
random name and creates file in exclusive mode.  If somebody
already has this file the utility loops.  The point here is
that with some amount of randomenss chance of clash is
reasonably low and the way of opening means that file
is unique.  That would need Posix bindings -- I am
thining of adding that (bypassing Lisp), but other
things keep me busy.

-- 
                              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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/E1gxbDn-0002NP-DE%40hera.math.uni.wroc.pl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to