On 07/11/2012 03:04 AM, Timon Gehr wrote:
On 07/11/2012 02:03 AM, Walter Bright wrote:
...
So do I. But all language design involves tradeoffs. I believe the
advantages of const toHash etc. outweigh the disadvantage of less
straightforward memoization.


I use unbounded data structures. Those have to be initialized lazily
and therefore the non-constness of their methods invades the entire
code base which is written in OO and functional styles (and a good
portion of Metaprogramming to remove the boilerplate). Most methods
that would be considered const cannot be, because they may trigger
extensions of the unbounded data structures somewhere down the road.


(conceptually, the structures are immutable and infinite.)

Reply via email to