Closed orlp closed 9 years ago
How about putting .x
seeding into S
- S
has no function on ints, and it's mnemonic.
Or O
on negative inputs?
@isaacg1 I'm not certain about the negative input to O
, but definitely not S
. That instruction is way too valuable to waste on seeding.
OK, I like O on negative inputs, because we're already breaking up O
on ints between positive results, which are used as ranges, and 0, which is used to get a random float between 0 and 1.
Negative sound good, but I do suggest that O_1
becomes random.seed(1)
, not random.seed(-1)
.
I'll work on a commit, give me a few.
Agreed.
What should the return value be? The input? 0? The seed? I like the seed.
@isaacg1 Hrm, whatever it is, I don't want it autoprinted, I think.
Unfortunately, if we go with O
, autoprinting is unavoidable. Autoprinting doesn't seem the inputs to the function. To avoid autoprinting, we should select a different function.
@isaacg1 No, we could make O_1
return None
, and disable printing of anything that returns None
at the top level.
At least, I don't think Pyth uses None
anywhere, but if it's a valid value we can also create a custom type, DoNotPrint
or something.
Hm. Yes, that seems like a good solution. I forgot that we could just change Pprint
.
@isaacg1 None
or a custom DoNotPrint
type? I personally None
.
None. I can't think of a good reason to print None, even if it is currently possible, which I'm not sure of.
Implemented.
@isaacg1
I'll work on a commit, give me a few.
:(
Sorry about that - I'd mostly already done it all before I even started commenting.
Making a separate issue for this. Right now we have a couple culprits:
.*
seems to be useless, you always use.u
..x
is partially useless. We should move the seeding function to somewhere else..=
is useless since https://github.com/isaacg1/pyth/issues/97.I don't have a great idea of where to put the seeding of
.x
. I think we should rename.u
to.*
however.