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

priority hints and callback names with func keyword #59

Open
cooper opened this issue Mar 7, 2017 · 1 comment
Open

priority hints and callback names with func keyword #59

cooper opened this issue Mar 7, 2017 · 1 comment

Comments

@cooper
Copy link
Owner

cooper commented Mar 7, 2017

func enterBar {
    need $name: Str
    say("Welcome $name.")
}

func enterBar before :default, :checkID {
    want $age: Int = 0
    if $age >= 21
        return
    fail Error(:UnderageError, "sorry...")
    stop # cancel all remaining callbacks
}
@cooper
Copy link
Owner Author

cooper commented Mar 7, 2017

Maybe having two keywords func and on is too confusing? I could get rid of on... or maybe that would be even more confusing.

If I did get rid of on, func would have to accept any expression as its argument, and in the case of a bareword, it would have to create a new event if the bareword evaluated to undefined (as on currently does).

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

1 participant