Do not use hash-map constructor in destructuring to avoid multiple key check.

Description

What I did:

What I expected:

What I got:

Using into or a combination of reduce and assoc instead of hash-map would allow this without breaking things.

If this is a desired modification, I can provide a patch. (CA is filed.)

Environment

Clojure versions 1.2 and above

Attachments

1

Activity

Show:

Meikel Brandmeyer April 25, 2012 at 8:30 PM

Deleted obsolete patch.

Andy Fingerhut April 25, 2012 at 1:39 AM

Removing patch clj-763-destructuring-allow-dup-keys-patch2.txt dated Mar 26 2012 in favor of Meikel's Apr 23 2012 patch, which fixes the problem in a faster way, and its test is more straightforward.

Meikel Brandmeyer April 24, 2012 at 12:10 AM

Uploaded 0001-Do-not-check-for-duplicates-in-destructuring-map-cre.patch with a faster implementation accessing the unchecked constructor directly plus a simplified test case. Supersedes the two previous patches. (I can delete only mine, but not Andy's.)

Meikel Brandmeyer April 24, 2012 at 12:08 AM

Map destructuring without duplicate check with test case

Rich Hickey April 13, 2012 at 3:29 PM

I'm happy to see this improved, but it has to be fast. into + partition is not fast enough down here. Probably should instead call non-checking map ctor

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created March 21, 2011 at 10:23 AM
Updated May 19, 2012 at 2:37 AM
Resolved May 19, 2012 at 2:37 AM