Custom Query (1630 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (25 - 27 of 1630)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Ticket Resolution Summary Owner Reporter
#218 worksforme random not random Jim Ursetto
Description

So rand() is completely subpar at generating random numbers in two ways:

  1. Lower bits are not random. We already work around this in the standard manner by scaling the result of a floating-point division.
  1. Nearby seeds don't affect the output much.

Due to # 2, on Mac OS X we may obtain the same initial random number for a minute or more, even though it is seeded with (current-seconds):

while :; do csi -p '(random 1000)'; sleep 5; done
734
734
734
734
734
209
209

We can fix the problem on OS X by using random(3) instead of rand(3), which is present on all BSDs and on Linux.

Internally, Linux uses random() when rand() is called and some BSDs seem to as well. However, there should be no harm anyway in applying the attached patch, which affects linux and bsd.

#223 fixed unbound proc error in alist->hash-table Jim Ursetto
Description

This error goes away if you use data-structures along with srfi-69.

$ cat > aa.scm <<EOF (use srfi-69) (alist->hash-table '((foo . bar))) EOF

$ csc aa.scm $ ./aa

Error: call of non-procedure: #<unbound value>

Call history: aa.scm:2: alist->hash-table

#224 fixed map allows non-list arguments felix winkelmann Jim Ursetto
Description

If the first list argument to map is not actually a list, map will just return (). Version: git fd66e1b (master)

#;1> (map (lambda (x) x) 'foo) () #;2> (map 'foo 'foo) ()

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Note: See TracQuery for help on using queries.