const as default for variables

via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 15 07:16:41 PDT 2015


On Sunday, 15 March 2015 at 13:21:11 UTC, Sönke Ludwig wrote:
> My proposal would be to make "scope" (with strong recursive 
> guarantees) the default instead to achieve that goal. That 
> would give the compiler a lot of optimization potential (much 
> more than just for RC), and would at the same time most 
> probably be a lot less limiting. It would also be a nice 
> documentation trait to see where references are stored for 
> later use. And it could even be used to implement checked 
> safety for calling C/C++ functions with GC references.

Please see my newest scope proposal, which I just posted here:
http://forum.dlang.org/thread/tlupkiiarrabqaxtayci@forum.dlang.org#post-tlupkiiarrabqaxtayci:40forum.dlang.org

It does almost what you suggest, but only for @safe functions, to 
avoid breaking too many things. A change à la "@safe by default" 
would then have the same effect.


More information about the Digitalmars-d mailing list