I guess I haven't written in a while. I had more to say on the last topic, but I will have to come back to it. At the moment, my head is full of ideas inspired partly by a new D Programming Language feature (http://www.digitalmars.com/d/lazy-evaluation.html) and partly by this article ("Enforcements" http://www.ddj.com/dept/cpp/184403864) which I found for the first time a few days ago when I was reading about D's lazy evaluation (I know, it's an old article).
The Enforcements article gives extremely good coverage of how to use templates and macros in C++ to implement a rich "idiom" of code that enforces various conditions at runtime. The article on D's lazy evaluation shows among other things how this feature can be used to improve upon the implementation of the enforcement idiom in D. I want to take this a bit further and look at how readability and writeability of such idioms could be improved by building support for them into the language from the beginning. Here are some initial observations and assumptions I have when approaching this problem:
In addition, I was thinking about a broader goal:
Among the preprocessor functions/tricks I am referring to are:
I'll outline some of my ideas in the next post.