Comments (7)
Hi Ella,
I dont think this is a problem as far as I remember. Not sure if the semantics have changed after that.
Defer is considered as an action handler and hence
//defer PONG;
//on PONG do Action1;
is like defining multiple action handlers for the same event and is considered as an error.
on SUCCESS goto WaitPong;
defer SUCCESS;
This is fine because one is an action handler and the other is a transition. Transition has higher precedence over action handler, we should add a test case to assert this.
from p.
Hi, Ankush,
Just to be sure I understand: are you saying that the attached test is compiled correctly and there should be no static error?
from p.
I think Ankush is right about his recollection of the design. But I am now wondering if the design should be changed to meet Ella's expectations. It is just confusing to allow more than one "action" for an event in a state.
from p.
Sorry, closed by mistake.
from p.
This design decision was made to be consistent. For example, because of push-transitions there is a possibility that actions and transitions may be defined for an event in a state (inherited actions). In that case, transition gets higher priority over actions.
from p.
I think that the behavior should be as follows:
- Error if some common event in "goto", "push", or "do"
- No error if same event in "deferred" and "goto"
- No error is same event in "deferred" and "push"
- No error if same event in "deferred" and "do"
Using the approach above, we do not lose any generality and it is less confusing to the programmer. The reason for allowing an event to appear in both "deferred" and one of the other categories is that the "deferred" annotation is applicable only to dequeued events and not to raised events. It is possible that the programmer wants to do something only when an event e is raised but does not want to dequeue e in some state.
from p.
On second thought, I think it is nicer and less confusing to disallow event duplication. I have fixed the type checker.
from p.
Related Issues (20)
- `GuaranteedWithDrawProgress` in Tutorial 1 is inaccurate/misdocumented HOT 4
- Internal Error: No such file or directory HOT 1
- In trace logs enums are printed as integers and its annoying!
- Unable to compile due to "no viable alternative at input" HOT 9
- Infinite loop in Timer module HOT 3
- Case expressions HOT 1
- Assert's error message is eagerly evaluated HOT 2
- Upgrade to Newer .Net Version HOT 1
- T
- High quality P Icon HOT 2
- "defer" and "ignore" statements not documented HOT 1
- Feature request: machine-local types HOT 1
- Upgrade to Newer .Net Version HOT 4
- Questions about FailureInjector.p
- Question about P Foreign Interface
- Does P really no longer support generate C/C++ Language ? Or when can you turn this feature back on
- p command line prints invisible/white text HOT 2
- How to use C as foreign language in P?
- Log monitor state or a custom message when it is in a hot state at the end of a schedule
- Feature request: bitwise ops or expression syntax for set operations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p.