-
Notifications
You must be signed in to change notification settings - Fork 4
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
Alternative Syntax #14
Comments
Hi @thysultan, I am not so sure that would work, have you tried it? both operators Finally, remember that JS also doesn't need try {
} return (type) {
} You are actually writing: try {
} // no catch nor effect handler
return (type);
{
// escoped block
} |
If nothing else, the syntax should be try {
// ...
} handle (effect) {
// ...
} So that there aren't any implicit/phantom variables in the code. The current syntax also makes Similarly, everyone knows the try {
// ...
} catch (err) {
// err or whatever variable name i want to give it
} |
Totally agree @lukeed |
On the issue of Throwing other suggestions on the wall: try {
yield 'ask_name'
} catch* (type) {
switch (type) {
case 'ask_name': yield 'Arya Stark'
}
} The keyword |
@luizperes I don't think this is accurate.
You can even try it in your browser. It doesn't work. |
True that @thysultan and @taylor-cedar |
@lukeed Conditional keyword are fine. We already have some, like const async = 1; // OK |
In an effort to reduce the amount of new keywords this would pose to introduce (effect, handle and resume), the following can serve as a possible alternative, piggybacking on the return keyword.
Where
<
and>
respectively represent the direction of data flow.The text was updated successfully, but these errors were encountered: