[Haskell-cafe] Re: Fwd: Haskell as a religion

Chung-chieh Shan ccshan at post.harvard.edu
Fri Dec 19 11:09:01 EST 2008


Henning Thielemann <schlepptop at henning-thielemann.de> wrote in article <494AE7A3.3000306 at henning-thielemann.de> in gmane.comp.lang.haskell.cafe:
> In C/C++ referential transparent functions code can be declared by
> appending a 'const' to the prototype, right?

No.

$ cat x.cc 
int f() const;
int f() { return 3; }
$ gcc x.cc 
x.cc:1: error: non-member function ???int f()??? cannot have cv-qualifier

You can define a const member function, but it can call rand() just
fine.

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
If you want to go somewhere, goto is the best way to get there.
Ken Thompson.



More information about the Haskell-Cafe mailing list