4 ms·
? Are you sure you're not confusing Ruby with something else? x+y works just fine in Ruby.
by Turing_Machine 4y ago
? Are you sure you're not confusing Ruby with something else?
x+y works just fine in Ruby.
- lisper 4y agoYeah, I was misremembering the details. But here's an example of the sort of thing that I don't like. If I want to convert a number to a string, I do: x.to_s which would lead me to think that to take the square root of a number I would do: x.sqrt but I don't. It's: Math.sqrt(x) So for every operation I have to remember whether it is invoked by x.op or op(x). In Lisp I don't have this cognitive load. It is always (op x). That is not unique to Ruby. What is unique to Ruby is that the x.op style is applicable to literals. So you get weird things like 3.14159265.to_s which just looks bizarre to me.