Re:Lisping at JPL Revisited
by lisper on Sunday January 29, 2023 @04:13AM
(#34566312)
Yeah, 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.
If I want to convert a number to a string, I do:
which would lead me to think that to take the square root of a number I would do: but I don't. It's: 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.