Reconsider the old import syntax #17876
bohonghuang
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The new import syntax looks familiar and is friendly to newcomer from other language, but it seems not so suitable for Scala.
The import syntax should be distinct from the legitimate identifier as possible to make it clear. In Scala, both
*
andas
are legitimate identifiers while in other language such as Rust and Python they are not.`
can be used for disambiguation, but it should not be encouraged outside of test code, and the new import syntax forces the usage of`
when just importing*
, which is useful in some calculation-specific codes.The soft keyword
as
was dropped in given syntax and pattern binding and is only used in import syntax currently, which seems to violate the design philosophy of Scala.The old import syntax looks perfect, since neither
_
nor=>
is treated as a legitimate identifier so they can be easily recognized in the long import list. So the old import syntax may be a better choice than the new one?Beta Was this translation helpful? Give feedback.
All reactions