Ok. I guess in my mind it didn’t sound the way you interpreted it, sorry about that
Your post comes across a bit as “feigned surprise”
I tried to convene that I’d like to understand in what way people get to know and learn the language that makes this particular corner prone to confusion, because your experience is different to mine and I can’t tell how that went unless you tell me.
Regarding mental hiccups and writing bugs, they are going to continue to happen no matter how you alter the language. Mental hiccups are just that, I would not alter the language optimizing for mental hiccups, and writing bugs is something the language can attempt to ease but how do you make sure you are not unfolding a different kind of new confusions. We could list specific functionality in many languages destined to addressed specific kinds of bugs and those still happening (memory management in rust, null safety in kotlin, etc).
If the point is “behavior isn’t consistent with destructing in another context” then why only the pattern matching on val context is mentioned? Pattern matching exists in other places, which one is more relevant? why make it more like val, and not more like partial functions and
collect like operations? Akka is pretty big in scala land, and
recieve is such a partial function.
This is why I find it important to understand how you learned the language, and why some concepts stuck more than others in your head, to understand which contexts are more surprising than others. My case, for instance, is that I learned for as syntactic sugar for foreach, map, flatMap, and filter, back then I did not know about monads and the like nor I grasped the full extent to which it could be used, but I quickly mapped for comprehension to those 4 operations and I really liked the filtering capability.
So as not to mislead anybody: I spend all day coding in it for clients, with three-day breaks here and there to do Scala training for companies that need to get engineers up to speed. (Nowadays I’m a consultant, working for Bill Venners at Artima.)
Sort of same here.