{1 "this" 1 "is" 1 "strange"}
=> {1 "this", 1 "is", 1 "strange"}
(into {} {1 "this" 1 "is" 1 "strange"})
=> {1 "strange"}
{1 "this" 1 "is" 1 "strange" 1 "but" 1 "if" 1 "I" 1 "try" 1 "hard" 1
"enough"}
=> {1 "enough"}
Stu
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?
The literal representation is just blasted into an array map when the
number of entries are below a certain threshold (8 maybe). I think
the general view is that a literal with duplicate keys is the error
and to check for dups would sacrifice speed.
> (into {} {1 "this" 1 "is" 1 "strange"})
This uses a regular hash map.
> {1 "this" 1 "is" 1 "strange" 1 "but" 1 "if" 1 "I" 1 "try" 1 "hard" 1 "enough"}
I guess the threshold is indeed 8.
-m
On Jan 18, 6:46 pm, Stuart Halloway <stuart.hallo...@gmail.com> wrote:
> Is this expected behavior?
>
> {1 "this" 1 "is" 1 "strange"}
> => {1 "this", 1 "is", 1 "strange"}
This can only happen with literal maps containing 8 or fewer entries.
Rich has commented on it elsewhere.
No it doesn't apparently... it uses conj instead.
-m
The first part I knew, just wanted to verify that the second part was
expected. Thanks!
Stu