rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

RFC 1020: Multi choice control flow

Open aljazerzen opened this issue 2 years ago • 2 comments

One might say that this is not big enough change for a RFC, but hey let me have my fun.

I intentionally didn't push match in RFC title, because this is subject of the discussion.

aljazerzen avatar Jan 04 '23 15:01 aljazerzen

My major concern would be using == operator rather than full-blown pattern matching:

  1. We mentioned somewhere that we probably want to implement algebraic types somehow at some point
  2. Even without that it would be nice to match by string prefix, array patterns, and numeric ranges (Rust can do all these things, for example)

tailhook avatar Jan 04 '23 16:01 tailhook

rather than full-blown pattern matching

Yes, agree. The RFC does not even solve what the issue that requested it. My intention was to make something quick and extend it later.

Problem with that is that we should at least decide on syntax for pattern matching, otherwise we will probably run into backward incompatibility when adding it later.

Compiler team agrees that this RFC can wait and be extended to do pattern matching when algebraic types are a thing.

aljazerzen avatar Jan 04 '23 17:01 aljazerzen