Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-15 Thread François Perrad
2010/4/13 Aaron Sherman a...@ajs.com: On Mon, Apr 12, 2010 at 1:55 PM, Larry Wall la...@wall.org wrote: On Mon, Apr 12, 2010 at 07:24:37PM +0200, Moritz Lenz wrote: : 1. do all implementations of Perl6 generate the same sequence, given the : same initial seed. : : I don't think they

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-14 Thread Larry Wall
On Tue, Apr 13, 2010 at 01:29:59AM -0400, Aaron Sherman wrote: : PRNGs are often misrepresented as frivolous, but as I'm sure you know from : your work at JPL, high quality random sequences are much-prized, and any : language that starts off with some poor assumptions will ultimately pay for : it.

a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Dave Whipp
masak wrote: Modified: docs/Perl6/Spec/S32-setting-library/Numeric.pod Log: [S32/Numeric] removed method form of srand Overwhelming consent on #perl6 about this. - multi method srand ( Real $seed: ) multi srand ( Real $seed = default_seed_algorithm()) Seed the generator Crand uses.

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Mark J. Reed
On Mon, Apr 12, 2010 at 12:59 PM, Dave Whipp d...@dave.whipp.name wrote: 2a. If I spawn two threads (implicitly or explicitly), how do their RNGs interact? I.e. are Crand and Cpick thread-safe? I've noticed that this is a potentially-surprising source of lock contention in Java - all threads

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Moritz Lenz
Dave Whipp wrote: masak wrote: Modified: docs/Perl6/Spec/S32-setting-library/Numeric.pod Log: [S32/Numeric] removed method form of srand Overwhelming consent on #perl6 about this. - multi method srand ( Real $seed: ) multi srand ( Real $seed = default_seed_algorithm()) Seed

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Dave Whipp
Moritz Lenz wrote: 1) A RNG class (don't really care what the name is, for now) 2) An instance of that in $*RAND (which you can temp()) 3) rand() and srand() act on $*RAND 4) It should be easy to create instances of the RNG to use in your own class. The sounds reasonable. The one thing I'd

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Larry Wall
On Mon, Apr 12, 2010 at 07:24:37PM +0200, Moritz Lenz wrote: : Dave Whipp wrote: : masak wrote: : Modified: : docs/Perl6/Spec/S32-setting-library/Numeric.pod : Log: : [S32/Numeric] removed method form of srand : : Overwhelming consent on #perl6 about this. : : - multi method srand (

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Aaron Sherman
On Mon, Apr 12, 2010 at 1:55 PM, Larry Wall la...@wall.org wrote: On Mon, Apr 12, 2010 at 07:24:37PM +0200, Moritz Lenz wrote: : 1. do all implementations of Perl6 generate the same sequence, given the : same initial seed. : : I don't think they should. If you want that, use confuse a RNG