The programmers are not the ones to blame on that.. this is really a bad contract between the language and the programmer
Its the equivalent of a function named "getStone()" to return you a " Paper{} " :)
The programmers are not the ones to blame on that.. this is really a bad contract between the language and the programmer
Its the equivalent of a function named "getStone()" to return you a " Paper{} " :)
It does.
> and entirely unreasonable to expect to be required to provide a base as anything except an optional argument
It is optional.
> and certainly it is unreasonable to expect that that second optional argument is treated as not optional in a composition operation
I don't understand what you're saying here. It's never treated as required, it's just map supplies a parameter in that position, so it get's used. That's how optional parameters work.
The wat (if there is one) is that map provides extra arguments.
> It does.
Not quite: in some browsers (IE), a string starting with '0' gets interpreted as octal. So parseInt('041') === 33 in IE.
Guess how I found out about that.
I think in this case it's not parseInt that's at fault, it's the fact that map optionally passes additional arguments.