Re: New EEP draft: Pinning operator ^ in patterns
zxq9 <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <[email protected]> |
On 2021/01/29 7:31, Michael P. wrote: > :-) > >> Den tors 28 jan. 2021 kl 15:38 skrev Coconut <[email protected]>: > >> changing other scoping rules either, in either direction, in a way that >> preserves compatibility. That in turn limits a lot of other things. > > Scoping is easy: > > Every pattern, apart from LHS `=`, opens a new scope. ...except for the most common pattern matching situation of all: `case` Not having anonymous function heads and list comprehension iterators follow the way patterns work in case is jarring and probably the main thing I get confused looks from learners over. "Wait, why *just here* we can shadow a variable? Shouldn't it be the same as everywhere?" One Scope To Rule Them All is the cognitively consistent approach because closures exist. -Craig