Improve "Improve Contract Syntax" DIP 1009

MrSmith mrsmith33 at yandex.ru
Sun Nov 5 16:25:16 UTC 2017


On Saturday, 4 November 2017 at 15:38:42 UTC, Jonathan M Davis 
wrote:
> In principle, that would be nice, but in practice, it's not 
> really feasible. In the general case, there's no way to save 
> the state of the parameter at the beginning of the function 
> call (you could with some types, but for many types, you 
> couldn't). IIRC, it's been discussed quite a bit in the past, 
> and there are just too many problems with it.
>
> - Jonathan M Davis

What about making definitions in "in" block visible in "out" 
block?

void fun(int par)
in {
     int saved = par;
}
body {
     par = 7;
}
out {
     writeln(saved);
}


More information about the Digitalmars-d mailing list