[Issue 17928] [scope] `in` is not treated as `const scope`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 29 15:39:04 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17928

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #2 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
Personally, I think that it was a mistake to create a storage class which was
equivalent to two other storage classes, but clearly, a number of folks like
the idea.

I suspect that a lot of folks use in simply because it looks like the opposite
of out and don't really understand what it's supposed to do. And out of those
who do understand what it's supposed to mean, there's a high change that
they've misused it, because it was never checked. Also, while the basic idea of
scope is simple enough, what it actually means in practice was never defined,
increasing the chances that it was misued.

If we want in to mean scope const instead of just const, then we're going to
need a means of migrating to that without immediately breaking code - but we're
arguably going to need that with scope in general, because any place that it
was used aside from delegates has been a no-op, and once DIP 1000 is enabled as
the default, at least some of that code will break.

So, we need a plan in general of how to migrate towards DIP 1000 being the
default behavior once it's ready. And I don't see any reason why in's behavior
can't be changed as part of that just like scope's would be, since changing the
behavior of either is a breaking change.

--


More information about the Digitalmars-d-bugs mailing list