[MATCH-30] throw if binding name reused in the same pattern row Created: 10/Oct/11 Updated: 19/Oct/11 Resolved: 19/Oct/11 |
|
| Status: | Resolved |
| Project: | core.match |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | David Nolen | Assignee: | David Nolen |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Accepted |
| Approval: | Ok |
| Comments |
| Comment by Steve Miner [ 15/Oct/11 3:43 PM ] |
|
Checks for duplicate wildcard names in a pattern row. |
| Comment by David Nolen [ 15/Oct/11 4:05 PM ] |
|
You should be able to reuse bindings as is done in the red black tree pattern as there is no ambiguity there. If we can get that enhancement in I'll gladly accept this. Thanks for taking this on! |
| Comment by Steve Miner [ 16/Oct/11 3:53 PM ] |
|
The new patch allows OR patterns to reuse wildcards, but still complains if there are other ambiguities. I added a couple of tests to illustrate. |
| Comment by David Nolen [ 17/Oct/11 10:33 AM ] |
|
This looks good. It looks like you created this patch before I added your match-let. Mind creating a new version of this patch against HEAD? Thanks much. |
| Comment by Steve Miner [ 18/Oct/11 2:47 PM ] |
|
Updated patch for latest HEAD |
| Comment by David Nolen [ 18/Oct/11 7:14 PM ] |
|
I'm trying to apply with patch with git am, but I keep getting: Applying: * src/main/clojure/clojure/core/match.clj: Add Stephen Miner's match-let It looks like the previous commit of my pasting of your match-let patch is mixed up into your latest patch. |
| Comment by Steve Miner [ 19/Oct/11 7:22 AM ] |
|
Sorry, I made a git mistake with dup3.patch. I made a fresh patch called dup4.patch that should fix the problem. |
| Comment by David Nolen [ 19/Oct/11 9:57 AM ] |
|
Fixed https://github.com/clojure/core.match/commit/819f7f7d874f63b74ba634a9bebc95da574d80eb |