Hacker News new | ask | show | jobs
by tjwii 3092 days ago
I think immutability of arguments should be optional by using a const keyword, like in c:

  int add(const int a, const int b);
2 comments

The downside to this syntactic approach is that the implementation details are leaked in the signature.
I think it would better if they were immutable by default and instead of making them const, you would mark them mutable or reference.