September 14, 2003
I think this goes hand with hand with the compile time assert thing.

int foo()
out (result) { assert(result!=0); }
body { return 0; }

Obviously the contract is violated and always will, but it still compiles. Can't these kind of things be detected at compile time?

The other thing, if we already have 'result' for out contracts, why not also having them for the entire function body?

-------------------------
Carlos Santander


---

Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.516 / Virus Database: 313 - Release Date: 2003-09-01


September 15, 2003
"Carlos Santander B." <carlos8294@msn.com> ha scritto nel messaggio news:bk0e60$2mme$1@digitaldaemon.com...
> The other thing, if we already have 'result' for out contracts, why not
also
> having them for the entire function body?

You have my vote! I'd like "result" to be a keyword meaning a reference to the function's result, so it can be a lvalue. I use this feature in Delphi a lot.

Ric


Top | Discussion index | About this forum | D home