← Back to context

Comment by y1n0

3 months ago

Immutability is definitely first class in clojure, but you can work with mutable structures when you need to.

This is sounds like memory safety in C++.

https://www.infoworld.com/article/3714401/c-plus-plus-creato...

  • This seems like a meaningless criticism when it comes to immutability in Clojure. You can have mutability in Haskell too. That doesn’t make it as unsafe as memory management in C++.

    • > You can have mutability in Haskell too.

      Haskell enforces this via a type system.

      What safeguards around mutability does Clojure have?

      If I import a method 'foo()', is there any kind of contract, notation ... anything which could suggest whether it mutates or not?

      1 reply →