[D2] How to not full closure?
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Wed Jul 30 15:26:57 PDT 2008
Sean Kelly wrote:
> == Quote from Bruno Medeiros (brunodomedeiros+spam at com.gmail)'s article
>> Jarrett Billingsley wrote:
>>> "Koroskin Denis" <2korden at gmail.com> wrote in message
>>> news:op.ueaoscr8enyajd at proton.creatstudio.intranet...
>>>> Shouldn't it be heap-allocated by default? I prefer scope keywork reuse :)
>>> You have a point there. And I think you may have something with using
>>> 'scope' to indicate nested functions whose stack frames are not to be
>>> heap-allocated. It goes along with scope classes nicely. You wouldn't be
>>> able to return a scope delegate, and it makes sense -- "this delegate only
>>> works in this scope. When the scope leaves, the delegate is no longer
>>> valid."
>>>
>>> Adding "scope" also makes it possible for the compiler to check that you
>>> don't do stupid things statically, at least in many cases.
>>>
>>>
>> I think Walter's solution ("using 'scope' to tag function parameters
>> that do not escape") may be even better. It doesn't add new syntax to
>> literals, is statically verifiable more "locally", and may have other
>> uses other than for delegates.
>
> Tagging the stuff that doesn't escape isn't backwards-compatible with
> D 1.0, where non-escaping is the default. Not that we don't already
> have some pointless portability issues from D 1.0 to D 2.0, but I'd
> think it would be desirable to not add more.
>
>
> Sean
D 2.0 vs 1.0 is not like Java 1.5 vs Java 1.4, or C# 2 vs. C# 3.
D is still very "experimental" and very under development, and, for
better or worse, that makes the differences between D 2.0 and 1.0 many,
profound, and ever-increasing. The "worse" part is that it makes it very
hard to maintain compatibility, perhaps even unpractical at all?
I wish there wasn't a need or desire to maintain 1.0 compatibility, and
people would move to 2.0. The sole key to this being Tango of course. I
understand you have good motives for not moving to 2.0 yet, but I hope
those can solved quite sooner rather later. The D community has allways
been divided in two camps, but never has the "rift" been so wide and
hurtful as now. :/
--
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list