[MATCH-44] regroup-keywords should not use gensym Created: 12/Dec/11 Updated: 12/Dec/11 Resolved: 12/Dec/11 |
|
| Status: | Resolved |
| Project: | core.match |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Steve Miner | Assignee: | David Nolen |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code |
| Description |
|
I contributed the regroup-keywords function to allow 'flattened' match syntax for :when and :as. It used gensym to make a marker to simplify the algorithm. After seeing how other people had done similar things with sentinel values, I realized that (Object.) is a better unique value. Theoretically, an evil user could use the same symbol that the gensym had created. Also, it's better to test with identical? rather than = since the sentinel is unique. I will attach a patch with a slight refactoring. |
| Comments |
| Comment by David Nolen [ 12/Dec/11 9:30 PM ] |
|
Fixed, https://github.com/clojure/core.match/commit/6d0f3fe33c4a85a12366d447e82cab59e299f94a |