DIP 1009--Improve Contract Usability--Preliminary Review Round 1

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 23 11:56:51 PDT 2017


On 23.06.2017 06:27, MysticZach wrote:
> On Friday, 23 June 2017 at 00:17:23 UTC, Steven Schveighoffer wrote:
>> We can call that contextual "keyword" result. Doesn't have to be a 
>> keyword, just the implied return value symbol name.
> 
> Another problem is that any given contextual reserved identifier you 
> choose will run the risk of shadowing other variables. `result` could 
> easily already be defined in an outer context. A solution to this is to 
> use a variable starting with `__`, as those are the existing way of 
> defining reserved identifiers. Maybe `__result`?
> 
> 

out{ assert(__result>0); } actually works already, but I think it is 
undocumented. ;)


More information about the Digitalmars-d mailing list