This is a good point. With an explicit short operator (either &
or something else, maybe even c
like R), this seems like something that could be implemented just as a stdlib/library level, and would bring pretty much the same benefits (quick example: Scastie - An interactive playground for Scala.)
I have mixed feelings about the proposal overall. Like Jeremy mentions, I don’t think I would like this on production code (it seems too easy to accidentally use a change collection’s type) and, while I understand that there’s no ambiguity with using [
/]
, it can still be a bit confusing IMO (I don’t have a good example, but I imagine that you can get some good puzzlers out of there).
However, I do think I would use it for tests, “configs” (sbt, mill…) and maybe quick scripts. I can also see it being useful on some linear algebra problems.
So, I do see some use for this, but for my use cases it would be OK to just be part of the stdlib (not the compiler) - ideally under an import (similar to chainingops
), so that it would be easy to opt out