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
When implementing the code snippets for the website, I created this short program:
target Rust;
main reactor {
state count:u32(1);
logical action a;
reaction(startup, a) {=
let tag = ctx.get_tag();
println!(
"{}. Logical time is {}. Microstep is {}.",
self.count,
tag.duration_since_start().as_nanos(),
tag.microstep(),
);
if self.count < 5 {
self.count += 1;
ctx.schedule(a, Asap);
}
=}
}
In your first example, you have not declared a as an effect of the reaction. It is only declared as a trigger and hence it is not mutable to prevent accidental scheduling. In your other example repeat is declared as an effect of the reaction and hence it works.
lhstrh
changed the title
Logical actions in main reactors aren't mutable, making them not schedulable
In generated Rust code, logical actions in main reactors aren't mutable, making them not schedulable
May 2, 2022
When implementing the code snippets for the website, I created this short program:
It doesn't compile:
This is not a problem outside of main reactors.
The text was updated successfully, but these errors were encountered: