I have a bunch of students this quarter that are writing code like this:
(- (random 1 9) 1)
Why? because they tried writing
(random 0 8)
and got a contract error, to wit:
random: contract violation
expected: (integer-in 1 4294967087)
I’m assuming that this contract was written by someone who imagined that the
recipient would realize that the first argument could be omitted entirely, but
my sample suggests that’s not the case.
Would it be all right to just change the contract to allow zero as a first
argument? I’d be happy to submit a pull request, if so.
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.