lame question
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Apr 19 12:50:41 PDT 2011
On 4/19/11 1:04 PM, Timon Gehr wrote:
> Steven Schveighoffer wrote:
>> And one other note -- delete will eventually be deprecated. In order to
>> free memory, you must use clear and GC.free.
>
>> -Steve
>
> Well, why? It seems like a bad decision to me.
The feature is not going away, just the keyword.
"delete" is a gratuitous carryover from C++, which had to invent it
because the need for manual object disposal predated the introduction of
templates.
D stays a systems programming language but also has a safe subset and
generally offers better safety guarantees than C++. It is excessive to
allocate a keyword to a feature that's fundamentally unsafe,
particularly since the underlying feature offers considerably fewer
guarantees than its C++ counterpart. (Some GCs are unable to implement
"delete" meaningfully.)
Manual memory disposal for the GC heap will be implemented as a template
function with semantics defined by the GC implementation.
Andrei
More information about the Digitalmars-d
mailing list