Reading @a_hoverbear's post on state machines.
https://hoverbear.org/blog/rust-state-machine-pattern/#three-state-two-transitions …
Now wondering: what if From/Into impls would be possible for enum member -> member. Could that be an angle to make state machines easier to write?
-
Show this thread
-
Replying to @yoshuawuyts @a_hoverbear
I recently explored this to implement `Bowling.` The biggest pain was not being able to define enum subsets. Every `state + event` transition needs its own TransitionResult enum and `impl From<TranstitionResult> for StateNode` that's pure repitition
1 reply 1 retweet 5 likes -
The result, if you're interested:https://exercism.io/tracks/rust/exercises/bowling/solutions/9b603f0e6cff4b6f8b00bb52c9102ddd …
1 reply 0 retweets 5 likes
Replying to @Michael_J_Ward @a_hoverbear
Thanks for sharing!
7:58 AM - 29 Mar 2020
from Berlin, Germany
0 replies
0 retweets
4 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.