Fwd: [Haskell-cafe] Haskell as a religion

Isaac Dupree isaacdupree at charter.net
Thu Dec 18 19:25:28 EST 2008


Henning Thielemann wrote:
> Alberto G. Corona schrieb:
>> But many features need other features. For example, the option to use
>> referential transparency will be common in future languages for
>> multicore programming purposes.  This creates the problem of separating
>> side-effect-free code from side-effect code.
> 
> In C/C++ referential transparent functions code can be declared by
> appending a 'const' to the prototype, right?

not quite.  GCC allows __attribute__((__const__)) or 
__attribute__((__pure__)), to declare that, though (one of 
them allows reading global variables, the other doesn't, I 
forget which).  In C and C++ per standard, "const" can only 
be applied to types, e.g. function arguments (including 
C++'s implicit *this, via funny location of "const").  Maybe 
C99 made up an additional way to use it, as it introduced 
"restrict", I forget

-Isaac


More information about the Haskell-Cafe mailing list