confusing (buggy?) closure behaviour

Christopher Wright dhasenan at gmail.com
Sat Dec 13 06:09:03 PST 2008


Zoran Isailovski wrote:
> Oh... I've got the wrong impression from the papers about D. (But then, why would someone design an *unsafe* language *by intention*??? For that, we've got C and C++, don't we?)
> 
> Anyway, I've been looking for a modern and *safe* language, but without the overkill of a Java VM or .NET runtime. My hope was with D, but you seem to be convincing me otherwise...
> 
> Does the "D is unsafe by intention" relate to D2.0, too?

D tries to make it easy to do the safe thing. It's a systems language, 
so it has to allow you to do unsafe things without too much trouble -- 
but usually with some not-too-pretty syntax to indicate that you're 
doing something unsafe.

In this case, D1 fails. D2 works, though at the cost of additional, 
often unnecessary, heap allocation. Since D is a systems language, this 
is not good and is due to change soon. At least, I think Walter said he 
plans to implement scope delegates in D2.


More information about the Digitalmars-d-learn mailing list