4 ms·
No, what Scala is giving you is the choice: use structural types, and sacrifice some of the benefits of nominal types, or don't. Note that if you perform your
by quatrevingts 15y ago
No, what Scala is giving you is the choice: use structural types, and sacrifice some of the benefits of nominal types, or don't. Note that if you perform your renaming and now class C no longer matches structural type S, any part of the code that depended on that typing will no longer compile: safety is preserved. Structural types therefore only make renaming slightly less automatic. (And they're rarely used anyway.)
I'm also skeptical of your claim about Clojure symbols: can you not select a field using a runtime-computed values, thereby making perfect static refactoring intractable?
- pron 15y agoLike I said, I do miss instant IDE error highlighting. You could select fields using computed values in any language using reflection, but no, 99 times out of a hundred you use explicit symbols ("keywords") in Clojure.
- quatrevingts 15y agoLooking into keywords a bit, it seems that auto-rename is only going to work for namespace-qualified keywords, and even then, it's going to be hard if the ::keyword syntax is used, because the current namespace is determined dynamically.