WTF did happen with struct constructor and ref in 2.061 ?

js.mdnq js_adddot+mdng at gmail.com
Sat Jan 5 13:24:47 PST 2013


On Saturday, 5 January 2013 at 18:38:31 UTC, Mehrdad wrote:
> On Saturday, 5 January 2013 at 12:58:49 UTC, js.mdnq wrote:
>> You are saying because "visually" foo(S(2)) leaves the "scope" 
>> it is different than the others.
>
>
> No, he is saying so because the LANGUAGE (and I don't mean the 
> _compiler_) defines what "scope" means, and it also defines 
> when anything enters/leaves some scope.
>
> It also defines the lifetimes of variables, and for structs, 
> that's bounded to their scope.
>
>
> Your perception of what *COULD* have been an alternate 
> definition (or implementation) has zero bearing on anything, 
> because that's not what it means in D, period.


Oh please, 90% of the discussions on here are about what d is 
doing, should do, and will do, period!

The discussion came about because a change in the 
compiler/language and regardless of how you want to spin it, D's 
language specification is not set in stone and is not implemented 
perfectly in the compiler... and even if it were, it doesn't then 
mean that it does it the best way.



More information about the Digitalmars-d mailing list