Giter Site home page Giter Site logo

Comments (7)

ankushdesai avatar ankushdesai commented on August 24, 2024

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.

ellab123 avatar ellab123 commented on August 24, 2024

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.

shazqadeer avatar shazqadeer commented on August 24, 2024

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.

shazqadeer avatar shazqadeer commented on August 24, 2024

Sorry, closed by mistake.

from p.

ankushdesai avatar ankushdesai commented on August 24, 2024

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.

shazqadeer avatar shazqadeer commented on August 24, 2024

I think that the behavior should be as follows:

  1. Error if some common event in "goto", "push", or "do"
  2. No error if same event in "deferred" and "goto"
  3. No error is same event in "deferred" and "push"
  4. 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.

shazqadeer avatar shazqadeer commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.