News for hackers. Stuff that matters.
Re:Are Monads a Waste of Time? by gowld on Wednesday February 21, 2018 @02:05AM (#16427490)
This is "const" in c++
Re:Are Monads a Waste of Time? by jordigh on Wednesday February 21, 2018 @10:05AM (#16429916)
I don't think this is the same. My C++ is getting rusty, so correct me if I'm wrong, but making a function const is mostly about making the "this" pointer const. A const function can still mutate global variables or call non-const functions, such as operator<< on cout. A pure D function can do neither of those things.
Re:Are Monads a Waste of Time? by gowld on Wednesday February 28, 2018 @08:08PM (#16488843)
That's fair. C++ has const methods on objects, but I think nothing at global scope. But you shouldn't have global mutable state :-)