Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for History states #17

Open
amithgeorge opened this issue Jun 12, 2023 · 1 comment
Open

Support for History states #17

amithgeorge opened this issue Jun 12, 2023 · 1 comment

Comments

@amithgeorge
Copy link

The statecharts website has an article on what are history states. From the article,

A history state is a pseudostate, meaning that a state machine can’t rest in a history state. When a transition that leads to a history state happens, the history state itself doesn’t become active, rather the “most recently visited state” becomes active. It is a way for a compound state to remember (when it exits) which state was active, so that if the compound state ever becomes active again, it can go back to the same active substate, instead of blindly following the initial transition.

Does clj-statecharts support history states? I had a need for this. My states were simple enough that I got by with adding a guarded "always" transition to the initial state that moved it to its sibling state.

@lucywang000
Copy link
Owner

No it doesn't support history state at this moment.

History state by its nature is stateful, but the core of clj-statecharts is pure functional so to implement this, we need to add a new key in the fsm to manage the stateful part, much like the :scheduler key for handling the delayed transitions.

Due to my own experience i don't quite understand the typical use case of history states. Can you educate me on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants