Re: Using 'def' does not create an array-map for small, non-empty maps
Ah, thanks! I had read it before and misinterpreted the actual process. Looks like I first need to send a signed copy of the CA before being able to make contributions! (That's going to be one long process for me - haven't been to a post office in ages! :-() -- jaju On Tue, May 8, 2012 at 8:07 PM, Armando Blancas wrote: > You may want to check out the info for contributors and JIRA: > http://www.clojure.org/contributing > http://dev.clojure.org/jira/browse/CLJ > > On Tuesday, May 8, 2012 2:01:57 AM UTC-7, jaju wrote: >> >> Sent the following to clojure-dev - but then it turned out to be a closed >> group for posting. >> Posting here as well: >> ==**==**== >> >> user> (class {}) >> clojure.lang.**PersistentArrayMap >> user> (class {1 1}) >> clojure.lang.**PersistentArrayMap >> user> (def m {1 1}) >> #'user/m >> user> (class m) >> clojure.lang.PersistentHashMap >> >> The following change fixes the issue: >> --**--- >> diff --git a/src/jvm/clojure/lang/**Compiler.java b/src/jvm/clojure/lang/ >> **Compiler.java >> index 0898f07..2cacd27 100644 >> --- a/src/jvm/clojure/lang/**Compiler.java >> +++ b/src/jvm/clojure/lang/**Compiler.java >> @@ -2837,7 +2837,7 @@ public static class MapExpr implements Expr{ >> ** .parse(context == C.EVAL ? >> context : C.EXPRESSION, ((IObj) form).meta())); >> else if(constant) >> { >> - IPersistentMap m = PersistentHashMap.EMPTY; >> + IPersistentMap m = PersistentArrayMap.EMPTY; >> for(int i=0;i> --**--- >> >> But an unwanted side-effect is that some tests (which wrongly depend on >> the order of elements in a map) fail, since PersistentArrayMap grows by >> adding new elements to the beginning of the internal array store. >> 1] test_pretty.clj#print-length-**tests >> 2] sequences.clj#test-flatten-**present >> >> Thoughts/comments? >> I'd like to fix and send a pull request! >> >> Thanks, >> jaju > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@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+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using 'def' does not create an array-map for small, non-empty maps
You may want to check out the info for contributors and JIRA: http://www.clojure.org/contributing http://dev.clojure.org/jira/browse/CLJ On Tuesday, May 8, 2012 2:01:57 AM UTC-7, jaju wrote: > > Sent the following to clojure-dev - but then it turned out to be a closed > group for posting. > Posting here as well: > == > > user> (class {}) > clojure.lang.PersistentArrayMap > user> (class {1 1}) > clojure.lang.PersistentArrayMap > user> (def m {1 1}) > #'user/m > user> (class m) > clojure.lang.PersistentHashMap > > The following change fixes the issue: > - > diff --git a/src/jvm/clojure/lang/Compiler.java > b/src/jvm/clojure/lang/Compiler.java > index 0898f07..2cacd27 100644 > --- a/src/jvm/clojure/lang/Compiler.java > +++ b/src/jvm/clojure/lang/Compiler.java > @@ -2837,7 +2837,7 @@ public static class MapExpr implements Expr{ > .parse(context == C.EVAL ? context > : C.EXPRESSION, ((IObj) form).meta())); > else if(constant) > { > - IPersistentMap m = PersistentHashMap.EMPTY; > + IPersistentMap m = PersistentArrayMap.EMPTY; > for(int i=0;i - > > But an unwanted side-effect is that some tests (which wrongly depend on > the order of elements in a map) fail, since PersistentArrayMap grows by > adding new elements to the beginning of the internal array store. > 1] test_pretty.clj#print-length-tests > 2] sequences.clj#test-flatten-present > > Thoughts/comments? > I'd like to fix and send a pull request! > > Thanks, > jaju -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Using 'def' does not create an array-map for small, non-empty maps
Sent the following to clojure-dev - but then it turned out to be a closed group for posting. Posting here as well: == user> (class {}) clojure.lang.PersistentArrayMap user> (class {1 1}) clojure.lang.PersistentArrayMap user> (def m {1 1}) #'user/m user> (class m) clojure.lang.PersistentHashMap The following change fixes the issue: - diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index 0898f07..2cacd27 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -2837,7 +2837,7 @@ public static class MapExpr implements Expr{ .parse(context == C.EVAL ? context : C.EXPRESSION, ((IObj) form).meta())); else if(constant) { - IPersistentMap m = PersistentHashMap.EMPTY; + IPersistentMap m = PersistentArrayMap.EMPTY; for(int i=0;ihttp://groups.google.com/group/clojure?hl=en