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

minor clarification for matching pairs (documentation) #29

Open
tpapp opened this issue Jan 5, 2017 · 1 comment
Open

minor clarification for matching pairs (documentation) #29

tpapp opened this issue Jan 5, 2017 · 1 comment

Comments

@tpapp
Copy link

tpapp commented Jan 5, 2017

In retrospect it is pretty obvious, but I needed to look up the associativity of => to figure out how to match Pair(x,y) expressions, ie

@match :(a => b) begin
    (x_ => y_) => (x,y)         # need parentheses
    _ => :unmatched
end

where x_ => y_ => (x,y) won't work because it is parsed as x_ => (y_ => (x,y)). Thanks for the great package, if you consider this issue too trivial just close it.

@MikeInnes
Copy link
Member

Not too trivial at all. It might be useful to have an examples.jl file or something with common patterns like this – feel free to open a PR for that.

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

No branches or pull requests

2 participants