|
|
|
|
|
by jjoonathan
4365 days ago
|
|
A very broad generalization of hash tables has been built into the language since day 1 so this feature is mostly for people who just want a structure that they are already used to (or don't want the extra behavior for performance reasons or whatever). Hash-tables in previous versions of Mathematica: >mymap["abc"]=1
>mymap[2]=2
>mpmap[hello]=3
>mymap["abc"]
1
>mymap[2]
2
>mymap[hello]
3
Whoa: >myDerivative[a_ x_^n_] = n a x^(n - 1)
>myDerivative[1.1y^3]
3.3 y^2
|
|
That said, Association[] looks nice. Presumably it gets a speed improvement by bypassing the pattern matching. And I remember being annoyed by using JSON data in Mathematica structures, this looks nicer. The literal syntax is appreciated too. Actually I'm kind of surprised they didn't choose another weird unicode symbol like 〚, for the literal syntax.