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

(hypirion.com)

33 points | by mirzap 4 days ago ago

4 comments

  • goldfishgold 2 hours 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 an hour ago

      Clarifying Clojure had them in 2007. Scala implementations were inspired by Clojure’s. Both Odersky and Bagwell have given credit to Hickey.

    • stingraycharles an hour 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 an hour 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.