4 ms·
Wait. Scala has unicode operators? Wow.
by runn1ng 13y ago
Wait.
Scala has unicode operators?
Wow.
- lmm 13y agoScala doesn't make a distinction between operators and methods, and Java has always supported unicode in method names, so they have to be possible for compatibility if nothing else. I think if used carefully, with discipline, they can make code more readable and ultimately more maintainable - e.g. for doing set algebra it's nice to be able to have ∪ and ∩ methods. But yes, if you want to shoot yourself in the foot with them it's very easy.
- joeygibson 13y agoI showed an example of using Unicode operators in a presentation I gave to the Atlanta group back in 2010. It doesn't say it in the slide, but when I gave the talk, I explained that while it sounds like a neat idea, you should probably avoid doing this. You can see the slide here, where I used a Delta as an operator slideshare.net/slideshow/embed_code/2923973?startSlide=9
- draegtun 13y agoPerl6 also has unicode operators - https://news.ycombinator.com/item?id=4942377 https://news.ycombinator.com/item?id=4942377