Closed rubyFeedback closed 2 years ago
Personally, I prefer Io's use of spaces over dots. It emphasizes that the operation is passing a message, not just a selector. Also, in particular, 2.sqrt
is much more difficult than 2 sqrt
to lex, because the .
is ambiguous as a selector versus a decimal point; Python also doesn't support this and requires e.g. (2).bit_length()
instead.
That said, if .
were to be made an operator character rather than an identifier character, then its expected behavior could happen just by defining something like Object . := method(call evalArgAt(0))
with an appropriate precedence in OperatorTable.
You say, you don't like the syntax "object slot", but a lot of people like the exact syntax as it is. Also, ":=" vs "=" introduces a little safety (you can't update ("=") uninitialized slot).
Anyway, Io is very flexible in the sense of syntax. You can find examples of lisp- and c- like syntaxes implemented right in Io. So if you prefer, you can do this yourself.
Many years ago I dabbled with Io and I liked quite a lot, including retrospection. Ruby admittedly got better over the years, but, say, back in 2006 or something like that (I don't quite remember when I first found Io but I think it was quite long ago on freenode #io) was newish to me.
The only complaint I have had about Io was the syntax. This includes e. g. "2 sqrt" versus "2.sqrt" but also the awkwardness of := rather than just =. I understand the intent, e. g. assign slot versus update slot, but my brain never came over that.
I suppose changing the syntax of Io is no longer possible due to backwards incompatibilities, but what if there would be a syntactic variant that would allow for e. g. "object.method" and "x = 42" notation? I suppose I would not be the only one who may find this interesting. Whether ti is worth to have this, I have no idea, but if there are more syntax oddities, well they could be thought through. And perhaps if it is to not depend too much on one person, one could do a poll and ask many people to participate, where a few poll options are related to syntax too. Syntax is not everything of course (a rich ecosystem may be even more important), but I always found syntax to be very important when you have to stare daily at written code/text. Anyway this is just a suggestion, please feel free to disregard and ignore if not applicable!