On Thursday, 6 February 2014 at 00:32:05 UTC, Manu wrote:
On 6 February 2014 09:16, Adam D. Ruppe <destructiona...@gmail.com> wrote:

And that's easy to fix too: make ALL variables scope, unless specifically marked otherwise at the type declaration site (or if they are value types OR references to immutable data, which are very similar to value types in
use).


Surely a simpler solution is to mark b scope too? Does that break-down at
some point?

scope in declarations is currently used as a storage class for
classes on the stack (a deprecated feature) so it couldn't be
used for class references until it's been removed from the
language for awhile. It does seem like it'd help the compiler a
lot if you disallowed assigning references to variables not also
marked as scope though.

It's probably hard to evaluate how big of a pain it'd be without
using it in real world code. It'd technically be a breaking
change but scope isn't implemented at all anyway so I think this
current users of scope would probably welcome a change that would
make it actually start working.

Reply via email to