<< Back to previous view

[MATCH-30] throw if binding name reused in the same pattern row Created: 10/Oct/11  Updated: 28/Jul/13  Resolved: 19/Oct/11

Status: Closed
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: Text File dup2.patch     Text File dup3.patch     Text File dup4.patch     Text File dup.patch    
Patch: Code and Test
Approval: Ok

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
error: patch failed: src/main/clojure/clojure/core/match.clj:1532
error: src/main/clojure/clojure/core/match.clj: patch does not apply
Patch failed at 0001 * 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

Generated at Fri Oct 20 22:19:55 CDT 2017 using JIRA 4.4#649-r158309.