retard wrote:
On the other hand Scala does provide a shallow form of immutability and some immutable data structures in the standard library.

My experience with shallow const (in C++) is that it's nearly useless. Most C++ code I've seen seems to rely on an implicit assumption of transitive const, but it isn't in the documentation and of course you don't know if it is upheld or not. This is not conducive to reliable FP.


> I don't know if
D2 provides any built-in immutable data structures. I guess just wrapping a data structure in immutable() won't suffice since there are probably some state changing functions in the mutable implementation that need to copy when dealing with immutable values.

Certainly, the D standard collection classes can improve, and they are being worked on.


The good thing in Scala and C# is that they both provide nice tools for expressing functional problems without too much verbosity. When the const system in D works, I guess it solves the other part of the problem. Too bad you can't have them all without resorting to pure functional languages.

Without transitive immutability and purity, it's like putting a frock on Schwarzenegger. That's why I've been so adamant about having transitive immutability in D. I don't agree with calling a language FP without it.

Reply via email to