"in" no longer "scope" since 2.079.0?

bauss jj_1337 at live.dk
Tue Mar 27 09:58:11 UTC 2018


On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
> On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via 
> Digitalmars-d-learn wrote:
>> Hello! Can someone point me to the changelong entry or maybe a 
>> pull request, wich changed the "in" from "scope const" to 
>> "const"? I thought the previous matter of things was pretty 
>> natural, and current "in" is now redundant. Would be glad to 
>> read up on this design decision.
>>
>> https://docarchives.dlang.io/v2.078.0/spec/function.html#parameters https://docarchives.dlang.io/v2.079.0/spec/function.html#parameters
>
> Because scope has mostly done nothing (it only affected 
> delegates), in has effectively been const without scope for its 
> entire existence in D2 in spite of the fact that it was 
> supposed to be the same as const scope. Now that DIP 1000 is 
> being implemented, and scope is actually going to do something 
> for more than just delegates, it was deemed too dangerous to 
> have in suddenly really mean both scope and const, because it 
> would potentially break a lot of code. So, in order to prevent 
> such breakage, in was changed to officially only mean const 
> instead of const scope. So, what it's meant in practice hasn't 
> really changed, but the spec has.
>
> https://issues.dlang.org/show_bug.cgi?id=17928
>
> - Jonathan M Davis

So now "in" is basically just an alias and serves no real purpose 
or is there a plan to eventually make "in" mean something other 
than just "const"?


More information about the Digitalmars-d-learn mailing list