8 ms·
I like that a lot, but the `to` syntax bugs me. Why not a colon, or Scala's `->`?
by shallot_router 9y ago
I like that a lot, but the `to` syntax bugs me. Why not a colon, or Scala's `->`?
- ssijak 9y agoYou type "->" faster and easier then "to"?
- shallot_router 9y agoNo, but it's visually clearer to me at a glance. It feels weird using letters, let alone full English words, to describe a mapping or anything else that I think a symbol is more suited for. To me it would feel like assigning a variable with: a equals 6 n equals "A" Just feels icky, somehow. Again, that wouldn't dissuade me from using the language whatsoever. It's only a minor irritation.
- mike_hearn 9y agoBecause "to" isn't actually syntax at all. It's an infix function that creates a Pair. You can alt-click it in the IDE to go to the definition.
- shallot_router 9y ago`->` in Scala is also just a method, but I think it's fair to call such things syntax even if they're not true "baked-in" language syntax.