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

Replace condition with the more powerful switch #36

Closed
roblabla opened this issue Aug 21, 2015 · 1 comment
Closed

Replace condition with the more powerful switch #36

roblabla opened this issue Aug 21, 2015 · 1 comment

Comments

@roblabla
Copy link
Member

Protocols define a data-type named "switch" which seem to handle everything condition does, in a cleaner, more readable way. It looks like this :

{
  "type": "switch",
  "typeArgs": {
      "compareTo": "this.someOtherArg",
      "fields": {
        "0": "int",
        "default": "void"
      }
  }
}

Void is a new datatype that does nothing. It doesn't read, and returns nothing. It may as well not have been called.

@roblabla
Copy link
Member Author

done with #43

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

No branches or pull requests

2 participants