
A Pattern for Head-mutable Structures in D - aldacron
https://dlang.org/blog/2020/06/25/a-pattern-for-head-mutable-structures/
======
arunc
The author is an expert D programmer and the post is too deep for beginners
and average users of D to understand. Here are the words from the OP from
Reddit. Ideally this should've been the first one/two paragraphs of this post.

[https://www.reddit.com/r/programming/comments/hfkq5e/a_patte...](https://www.reddit.com/r/programming/comments/hfkq5e/a_pattern_for_headmutable_structures_in_d/fw006xu/)

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.

~~~
biotronic
You're right - thank you for this constructive criticism. The post was
originally written as a DIP (D Improvement Proposal), and arguably suffers a
little because of that.

~~~
arunc
Haha. Honestly I thought this was some PL research paper. That was lot of
information (which is good). It might be worthwhile to point out on the blog
which DIP this was. Thanks.

