Communicating between in and out contracts

Lutger lutger.blijdestijn at gmail.com
Sat Oct 17 01:40:19 PDT 2009


Andrei Alexandrescu wrote:

> Lutger wrote:
<snip
>> 
>> What is the benefit of variants here? Maybe I'm missing something, it
>> just seems a little verbose and lose out on the type system (IDE support
>> and such). Wouldn't it also tie the variant type to the language or is
>> that not a problem?
> 
> The nice thing there is that you have a single type to be a generic bag
> for any types.
> 
> Andrei

How? I mean that is a property of variants in general. Pre- and 
postconditions are written next to each other. I don't see anything generic 
about them, what am I missing?

Let me rephrase that: if I have to write '*storage["oldSize"].peek!(int) == 
...' in the out contract as opposed to just 'oldSize == ...', how would that 
be a win?





More information about the Digitalmars-d mailing list