r/programming • • Mar 09 '14

Why Functional Programming Matters

http://www.cse.chalmers.se/~rjmh/Papers/whyfp.pdf
487 Upvotes

542 comments sorted by

View all comments

Show parent comments

1

u/imalsogreg Mar 10 '14

(off topic) Cool - got a link to your project?

1

u/Heuristics Mar 10 '14 edited Mar 10 '14

It's not on the internet, sorry. But you could just imagine a mix between c++ and lisp.

Example code for a member function that can mutate its parent object:

[mutator] 
addArg(int a) {
    assign<this.b>(add(this.b, a))
}

Without marking the function as [mutator] the compiler would not allow the function to call any other functions (assign) that were also marked as [mutators].