You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following on to my question in #23, I'm realizing that guards won't solve my problems, specifically, I'm implementing a series of menus that are driven by a pad of 16 buttons.. I'm trying to avoid creating unique events per button press/release while also allowing for using constants to identify details of the event matching so that I might easily use that same data to identify where to display something and potentially change the value of the constant (button that represents the transition/display area) in the future.
I'm wondering if it would make sense to expand the Event syntax to allow for pattern matching, so you can reuse the same event but with different patterns to specify different transitions:
BTW.. i ended up forking and implementing an approach that allows for patterns in events and uses match guards to implement the guards.. its a bit more verbose and less "tied together" (you have to implement the Events enum yourself).. but has some other benefits..
Following on to my question in #23, I'm realizing that guards won't solve my problems, specifically, I'm implementing a series of menus that are driven by a pad of 16 buttons.. I'm trying to avoid creating unique events per button press/release while also allowing for using constants to identify details of the event matching so that I might easily use that same data to identify where to display something and potentially change the value of the constant (button that represents the transition/display area) in the future.
I'm wondering if it would make sense to expand the Event syntax to allow for pattern matching, so you can reuse the same event but with different patterns to specify different transitions:
which I assume would generate code somewhat like:
The text was updated successfully, but these errors were encountered: