Re: Same ⟨pattern variable⟩ apparing two or more times
Amirouche 26 Dec 2022 11:52 UTC
> > What should happen when the same ⟨pattern variable⟩ appears more than one time in a pattern?
>
>
> For example
>
> (match '(42 42 nothing)
> ((,a ,a . rest) a))
>
> In my opinion, the above expression should eval to 42.
>
It appears, I am mistaken:
> In each ⟨pattern⟩, the ⟨pattern variables⟩ and ⟨cata variables⟩ must be pairwise disjoint (in the sense of bound-identifier=?).
Can you confirm that my new understanding is correct: variables whether they are pattern variables, or cata variable should appears once in a pattern?