Pure functions in D

bearophile bearophileHUGS at lycos.com
Wed Sep 24 14:18:46 PDT 2008


Bent Rasmussen:
> I find invariant more natural and immutable more clumsy.

Yet, it seems that's the right terminology:
http://en.wikipedia.org/wiki/Immutable_object


> On the other hand, why not make invariant the default and be 
> done with it. The trend will go in that direction

I agree that this seems where the trend goes, but:
- I think you can't change the language too much. D is too much based on mutable data to change it all now. So I think it may be better to invent a new language that uses mostly immutable data (Scala?) instead of turning D inside-out. I presume Walter too will invent other languages when D is finished, or even along the way.
- While today some languages show the advantages of immutable data, there's probably space still for a niche with a language with mostly mutable data structures. D is for that niche (today that niche is very large but it may shrink in the following years).

Bye,
bearophile



More information about the Digitalmars-d mailing list