ref parameters: there is no escape

bearophile bearophileHUGS at lycos.com
Sun Aug 14 12:08:13 PDT 2011


Andrei Alexandrescu:

> We found pernicious bugs in 
> our code caused by escaping reference parameters, and we're looking into 
> adding a rule in our lint program to statically disallow it. If that's 
> worthwhile (and I have evidence it is), then it's all the better to put 
> the check straight in the language.

Another possibility is to add it to an experimental branch of DMD, study its use and effects for some time, and then decide what to do of this idea.


> We talked about this, too. I even aired ~scope. Such a change would be
> doable but is liable to break a lot of code.

It's interesting to know how much code and how much hard the changes are to do.

Like in Go, a small tool similar to the one that converts Python2 code to Python3 code is getting useful in D too, to reduce the amount of work of people (including Phobos dev) that have to update D code to follow changed in D language.

Bye,
bearophile


More information about the Digitalmars-d mailing list