News for hackers. Stuff that matters.
Re:Launching Mathematica 10 by programnature on Wednesday July 09, 2014 @06:11PM (#8012526)
To be fair, fast immutable hash tables have only been around as a technology since around 2005. (Yes, Mathematica is mostly based on immutability) .Other than internal R&D, Wolfram never add experimental methods to Mathematica.

Of course, its always had lists of rules as a far more general (though much slower) form of the hash table concept.

Re:Launching Mathematica 10 by gohrt on Wednesday July 09, 2014 @07:24PM (#8012768)
I assume you mean persistent, not immutable.

    a[x] = 1
    b = a
    a[y] = 2  <---- mutates a
    a[x] = 3  <-- is this legal?
    b[x]    <--- persistent- uh, what is Mathematica's semantics here?
Re:Launching Mathematica 10 by taliesinb on Wednesday July 09, 2014 @08:04PM (#8012907)
Yes, Associations use the same basic algorithm as Scala and Clojure's hashmaps, and are indeed persistent.

And b[x] there gives 1 as you would expect.

Re:Launching Mathematica 10 by davorak on Wednesday July 09, 2014 @11:47PM (#8013492)
Do you know when that change was put into place? I have been using Mathematica sense version 5 and my intuition was that `b[x] == 3`. Testing in mathematica 8 which I have on hand confirms this.
Re:Launching Mathematica 10 by taliesinb on Thursday July 10, 2014 @12:21PM (#8015496)
Mathematica 8 doesn't have associations, so you must be testing symbol assignments.

Write a = <||> before running the above code to test this on associations; associations are persistent, the symbol table is not.

Re:Launching Mathematica 10 by programnature on Wednesday July 09, 2014 @07:36PM (#8012812)
No, I meant lists of rules like {a->1,b->2}, which capture the same kind of patterns as in the previous example but in an immutable (and copy-on-write) way.
Re:Launching Mathematica 10 by anaphor on Wednesday July 09, 2014 @07:14PM (#8012736)
just to clarify, you mean fast immutable hash tables that support insertion right? (Which I agree is hard) Otherwise you can just use a BST or something and it's fast enough for lookups.