A Pattern for Head-mutable Structures in D
dlang.org
dlang.org
https://www.reddit.com/r/programming/comments/hfkq5e/a_patte...
A common complaint about D's const is its transitivity makes it hard to use, and the blog post attempts to improve this situation by giving user-defined types the same power that built-in types have. Currently, the way to work around the issue is to simply not use const and instead rely on convention. Essentially, you'll write the same code in both cases, but currently the compiler gives you no help. I want the compiler to enforce these things, and I believe almost every D project could benefit from this.