See below.
What are you talking about? Nothing fails here.
It fails to pass my judgment as an appropriate language/library design
for how to raise one number to the power of another number. This is a
subjective discussion.
Straw man.
Yes, the "object" is `2' (or `(2)').
No. I don't want to send a message to the object 2. I don't want to
send messages to anything. I just want the value of the power and I
want to do that by a function call.
Non sequitur. Messages do not need to cause mutation.
No they don't but that is what the paradigm was primarily designed to
do and there is no need for it here.
If something can be just a simple function then let it be just a
simple function.
Several designers of other languages, in particular Smalltalk, would
disagree.
But they were wrong.
Because it is prefix instead of infix style?
Aesthetically yes but more substantially because it is a simple
function call rather than a message passing system.
Efficiency considerations
aside, that is is a matter of preference. And given that in math we are
writing
10
2
to display the value of "two to the tenth power", is it not more similar
and therefore more intuititive to write (2).pow(10) in source code?
I wouldn't rest my argument on the idea that Mathematical notation is
good. Mathematical notation is unnecessarily complex and unclear. For
example, the following is more than unfortunate. Any Math teacher can
attest to this example causing students a lot of grief.
-1
(sin(x))
-1
sin (x)
I know
at least one programming language that agrees here: bash (`$((2**10))').
Non sequitur. No namespace is needed where the context is clear.
I'm not saying the namespacing is required. I'm saying that having to
write eight characters for the name of the function instead of three
characters isn't something to get fussed about.
Peter