[MATCH-42] quoted symbols should be treated as literals Created: 30/Nov/11 Updated: 30/Nov/11 Resolved: 30/Nov/11 |
|
| Status: | Resolved |
| Project: | core.match |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Steve Miner | Assignee: | David Nolen |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Reported on the Clojure mailing list: From: Alex Miller <alex@puredanger.com> I've been working with core.match some this week and finding it pretty ;; translate (+ x (+ y z)) to (+ x y z) You will see this error: Any symbol inside a pattern row is treated as a bind variable. + is a (defn +? [s] (= '+ s)) (let [e '(+ 1 (+ 2 3))] but, yuck. I can imagine using the reserved ()'s with additional keys (let [e '(+ 1 (+ 2 3))] These come through as (quote x) although the error reporting goes a However, that seems fixable and you could then use (quote x) as a |
| Comments |
| Comment by Steve Miner [ 30/Nov/11 4:56 PM ] |
|
Skip anything that's quoted when looking for duplicate symbol names. Added a test for the reported case. |
| Comment by Steve Miner [ 30/Nov/11 4:57 PM ] |
|
patch attached |
| Comment by David Nolen [ 30/Nov/11 6:52 PM ] |
|
Fixed, https://github.com/clojure/core.match/commit/6721be4fba74561038539e12667bc04cc5fc94cc |