New attribute to control references

Loara loara at noreply.com
Tue Apr 26 10:48:52 UTC 2022


On Tuesday, 26 April 2022 at 00:16:23 UTC, Salih Dincer wrote:
> It sounds good!
>
> I will definitely read it, but it should not stay in theory.  
> Is there a way to try it?  For example, with the UDA...
>

Actually I haven't implemented it yet, since I don't know how to 
scan functions body and expressions in order to test code. 
Nothing forbits us to implement a `@rscope` UDA but it'd be 
useless until the compiler checks the code.

On Tuesday, 26 April 2022 at 00:16:23 UTC, Salih Dincer wrote:
> I think it makes a lot of sense!  I think rscope here means 
> @(referenceScope)?

A bit, since we're working with references the classical meaning 
of block scope is too restrictive since an object allocated via 
`new` can exist among different scopes.




More information about the Digitalmars-d mailing list