scope escaping

Adam D. Ruppe destructionator at gmail.com
Thu Feb 6 12:29:27 PST 2014


On Thursday, 6 February 2014 at 19:24:19 UTC, Elie Morisse wrote:
> How about letting the compiler decide what's best in the 
> default case?

The problem there is the compiler would have to look at the big 
picture to make an informed decision, and big picture decisions 
are generally hard to implement.

Determining whether it is GC or not automatically would require 
analysis of the function body, tracing where each reference ends 
up, and looking at other functions it gets passed to (which might 
not be possible if you have only the prototype without a body). 
Things like pure can help with it, but generally, I don't think 
the compiler can make a smart decision.


More information about the Digitalmars-d mailing list