confusing (buggy?) closure behaviour
Zoran Isailovski
dmd.zoc at spamgourmet.com
Sat Dec 13 02:52:58 PST 2008
BCS Wrote:
> Reply to Zoran,
>
> > I don't think it is restrictive if the compiler prevented a situation
> > that would otherwise lead to a run-time error anyway, or worse, weird
> > and confusing run-time behavior. In my case, if the compiler couldn't
> > SAFELY handle a reference to the argument n outside the enclosing
> > function, then, IMO, RETURNING it (but not otherwise using it) should
> > be flagged a compilation error. Admittedly, detecting this is a bit
> > more involved for the compiler, but not at all restrictive for the
> > user.
> >
>
> D2.0 handles it all correctly. D1.0 follows the "hear is a gun, there is
> your foot" mentality with regards to this. In general D is *not* a safe language
> and that is by intent.
>
>
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?
More information about the Digitalmars-d-learn
mailing list