Tuple DIP

Timon Gehr timon.gehr at gmx.ch
Mon Jun 3 17:43:36 UTC 2019


On 20.09.18 19:08, Guillaume Boucher wrote:
> On Saturday, 13 January 2018 at 18:28:55 UTC, Timon Gehr wrote:
>> However, this proposal is independent of all the other ones, so in the 
>> end it is up to Walter and Andrei.
> 
> Have there been any discussions regarding the semantics of _?
> 
> struct G { ~this() { writeln("destruct"); } }
> void main() {
>      auto _ = G();
>      writeln("here");
> }
> 
> The DIP currently says this should print first "here" and then "destruct".
> 
> However, as you cannot access the variable later, you most often want to 
> discard the data right away, i.e. print first "destruct" and then "here".
> 
> I personally find the second interpretation more useful.
> 

This has not been discussed, but I agree it should be addressed somehow. 
The main issue is that right now "_" is a valid identifier.


More information about the Digitalmars-d mailing list