ezyang’s blog

the arc of software bends towards understanding

The duality of weak maps and private symbols

From the files of the ECMAScript TC39 proceedings I want to talk about an interesting duality pointed out by Mark Miller between two otherwise different language features: weak maps and private symbols. Modulo implementation differences, they are the same thing! A weak map is an ordinary associative map, with the twist that if the key […]

  • March 19, 2013