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

Add support for a guard in pattern-matching function definition #98

Closed
evhub opened this issue Jun 21, 2016 · 1 comment
Closed

Add support for a guard in pattern-matching function definition #98

evhub opened this issue Jun 21, 2016 · 1 comment

Comments

@evhub
Copy link
Owner

evhub commented Jun 21, 2016

Should allow

def foo(x is int if x>=0) = x

that is, the general form

def func(pattern if cond):
    body

should be equivalent to

def func(*args):
    match pattern in args if cond:
        body
    else:
        raise MatchError()
@evhub
Copy link
Owner Author

evhub commented Jun 22, 2016

Currently live in develop.

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