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

Question about states and data #566

Open
kielby opened this issue Mar 11, 2023 · 2 comments
Open

Question about states and data #566

kielby opened this issue Mar 11, 2023 · 2 comments

Comments

@kielby
Copy link

kielby commented Mar 11, 2023

Is the statement on the tutorial pageoutdated?

SML states cannot have data as data is injected directly into guards/actions instead.

On the examples page in the data section it shows otherwise right? Or is the statement above regarding something else?
https://boost-ext.github.io/sml/examples.html#data

@MatthiasKleesSchulz
Copy link

Nope, the tutorial is not outdated. It is true, the STATE itself cannot have data. The example shows how u can store data in the STATEMACHINE. An other solution is to work with dependencies.

@martinerk0
Copy link

@MatthiasKleesSchulz Can I ask what's the difference between "states cannot have data" and "Another solution is to work with dependencies"?

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

3 participants