Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Evaluation Order Sucks

Name: Anonymous 2014-07-14 0:56

Just fixed an error with
array[count++]= foo();
where foo() modified count, in effect writing stuff into the incorrect location.

Haskell's lazy evaluation would have prevented that.

Name: Anonymous 2014-07-15 8:00

>>40

Random number generation is coupled to IO
Nope. rand() is defined to be linear congruential generator.

Name: Anonymous 2014-07-15 8:54

>>41
The seed still needs to come from somewhere, and just using something like the PID often isn't good enough.

Anyway, if you want to just discuss stdlib rand, POSIX defines a reentrant form (rand_r) for exactly the reasons already discussed.

Name: Anonymous 2014-07-15 9:04

>>42

The seed still needs to come from somewhere, and just using something like the PID often isn't good enough.

The right thing is to ask user himself for the seed, so that the code remains deterministic. Old NES games used user input timing to generate seed, despite the absence of timer and or any other external generator.

Name: Anonymous 2014-07-15 15:49

>>43
Linux /dev/random also works this way. Entropy is obtained from many sources, including user input if it is available (it isn't always). My point was that once you go down that path you must deal with synchronizing access to the entropy pool (for both readers and writers).

Name: Anonymous 2014-07-15 16:48

>>42
The seed still needs to come from somewhere
Definitely NOT from your peepee, impotent white virgin boy.

Name: Anonymous 2014-07-15 16:54

>>45
Making penises/testicles defunct is a valid form of penis punishment

Name: Anonymous 2014-07-15 18:03

>>46
Making penes/testicles valid is a defunct form of penis punishment.

Name: Anonymous 2014-07-15 18:44

>>44

You can have per-process entropy pool.

Name: Anonymous 2014-07-18 2:50

>>5

except indirect jumps

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List