Understanding Clojure's Persistent Vectors, pt. 1 (2013)

(hypirion.com)

29 points | by mirzap 4 days ago

1 comments

  • goldfishgold 1 hour ago
    Scala has a similar data structure https://www.scala-lang.org/api/2.13.6/scala/collection/immut.... Something was in the air in 2013.
    • swannodette 17 minutes ago
      Clarifying Clojure had them in 2007. Scala implementations were inspired by Clojure’s. Both Odersky and Bagwell have given credit to Hickey.
    • stingraycharles 45 minutes ago
      It’s not a secret that they came from the same zeitgeist but took wildly different approaches, but inspired each other.

      I still don’t understand why they’re referred to as persistent vectors rather than immutable vectors, but I digress.

      • lemming 21 minutes ago
        I still don’t understand why they’re referred to as persistent vectors rather than immutable vectors, but I digress.

        I believe that immutable just means, well, immutable, but persistent means that updates are achieved via structural sharing, so they’re efficient.