The state of contract programming in D

Stewart Gordon smjg_1998 at yahoo.com
Mon Mar 5 02:46:35 PST 2012


On 05/03/2012 04:26, Alex Rønne Petersen wrote:
<snip>
> Additionally, I think that dropping the need for parentheses on invariant declarations
> would be a good idea, such that it feels more like unittest declarations.
<snip>

It can't be done at the moment, because invariant is also the old name for immutable. 
Indeed, the brackets were introduced to distinguish between the two meanings, though it 
would have been better to introduce a new keyword in the first place rather than create a 
new meaning of invariant that required a change to existing syntax.

Stewart.


More information about the Digitalmars-d mailing list