Fully transitive const is not necessary

Walter Bright newshound1 at digitalmars.com
Wed Apr 2 15:34:48 PDT 2008


Steven Schveighoffer wrote:
> HOWEVER, the point that everyone is arguing is why does logical const make 
> pure functions or functional programming impossible?  Clearly, it is ALREADY 
> POSSIBLE to have logical const, and clearly, pure functions are possible! 
> I'm saying transitive const is mathematically equivalent to logical const 
> ALREADY.  Please try and grasp that concept.

You do not need const at all to do function programming. But if you do 
that, you'll give up all compiler help. What const/invariant does is 
enable the compiler to enforce certain guarantees.

Multiprogramming is notoriously difficult in languages that provide no 
language guarantees (like C++) and is fairly straightforward in 
languages that do provide guarantees (like Erlang). There has been 
recently a huge surge in interest in Erlang and Haskell for 
multiprogramming, and they are willing to put up with all the other 
faults in those languages, because people are able to get their 
multiprograms to work reliably in those languages without herculean efforts.



More information about the Digitalmars-d mailing list