As discussed in #579 (comment), we'd like to proceed as follows:
Original
There currently is no keyword for selecting alternatives in a match construct. Examples of match constructs are:
- Python
match x:
case Alt1: exp1
…
case AltN: expN
- Haskell
f = case x of
Alt1 -> exp1
…
AltN -> expN
or
f Alt1 = exp1
…
f AltN = expN
We probably want three keywords:
matched to select the value matched on, i.e., x;
<ordinal> pattern to select the i’th pattern, i.e., Alt1 to AltN above; and
<ordinal> case to select the i’th case, i.e., exp1 to expN above.
Unmodified pattern and case should probably to the scopes relative to the named mark or cursor, i.e., pattern refers to Alt1 if the mark or cursor is in either Alt1 or exp1, and similarly for case.
edit @pokey:
As discussed in #579 (comment), we'd like to proceed as follows:
"subject"scope type #1172"branch"scope type #1173"name"/"key"/"condition"for switch statements #1174"value"for switch statements #1175"inside branch"#1176Original
There currently is no keyword for selecting alternatives in a match construct. Examples of match constructs are:
We probably want three keywords:
matchedto select the value matched on, i.e.,x;<ordinal> patternto select the i’th pattern, i.e.,Alt1toAltNabove; and<ordinal> caseto select the i’th case, i.e.,exp1toexpNabove.Unmodified
patternandcaseshould probably to the scopes relative to the named mark or cursor, i.e.,patternrefers toAlt1if the mark or cursor is in eitherAlt1orexp1, and similarly forcase.