# An Alternative Pattern Matching Proposal

**URL:** <https://es.discourse.group/t/an-alternative-pattern-matching-proposal/394>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [July 10, 2020, 10:56pm UTC](https://es.discourse.group/t/an-alternative-pattern-matching-proposal/394 "2020-07-10T22:56:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wlib](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/wlib/32/887_2.png) [@wlib](https://es.discourse.group/u/wlib)\
**Post date:** [July 10, 2020, 10:56pm UTC](https://es.discourse.group/t/an-alternative-pattern-matching-proposal/394/1 "2020-07-10T22:56:33Z")

</div>

I wanted to use pattern matching, and found that there is an existing proposal at stage 1. Unfortunately, it really doesn't currently seem like it's very realistic. I came up with an alternative proposal [here](https://github.com/wlib/proposal-switch-match#readme), and would like to get some feedback. This proposal is meant to be very easy to implement and easily extendable. However, I'm debating whether or not this should be an expression or a statement (it is currently a statement).

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [July 11, 2020, 12:27am UTC](https://es.discourse.group/t/an-alternative-pattern-matching-proposal/394/2 "2020-07-11T00:27:21Z")

</div>

Could you elaborate on what seems unrealistic about it?

(Note that I've just taken over recently as champion for that proposal, and it hasn't yet been updated)

---

<div class="post-metadata">

**Author:** ![wlib](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/wlib/32/887_2.png) [@wlib](https://es.discourse.group/u/wlib)\
**Post date:** [July 11, 2020, 12:37am UTC](https://es.discourse.group/t/an-alternative-pattern-matching-proposal/394/3 "2020-07-11T00:37:31Z")

</div>

I had no idea about what you have now when I wrote this because I couldn't see your updates, so I went with what I saw:

- Examples in the readme itself contradict slightly
- The syntax is ambiguous and deviates from destructuring syntax in a potentially confusing way
- I saw several attempts to implement it with babel that ran into problems, so it seems too complicated for what it's worth
- It's taken quite a few years with little progress and I assumed that I could improve it by coming in from a slightly different approach

With that said, regardless of how realistic may be now with your updates, I think that my proposal is worth consideration
