Discussion about D at a C++ forum

Sean Kelly sean at invisibleduck.org
Mon Jan 9 09:34:49 PST 2012


Already possible via Runtime.collectHandler, though I'll admit it could be done more elegantly. 

Sent from my iPhone

On Jan 9, 2012, at 5:58 AM, "Steven Schveighoffer" <schveiguy at yahoo.com> wrote:

> On Sun, 08 Jan 2012 18:28:54 -0500, Mehrdad <wfunction at hotmail.com> wrote:
> 
>> 7. Unstable language. They're currently considering doing things like removing "delete" as it's apparently deprecated (which will officially make it not usable as an SP language).
>>    Looks 100% correct. Removing 'delete' /does/ make D unusable as an SP language... unless you ignore the GC completely, which isn't even possible, practically speaking.
> 
> C doesn't have delete.
> 
> But removing delete isn't the problem anyways.  Here is the problem (which exists with delete present in the language):
> 
> class C
> {
>   private int[] buf;
>   this() { buf = new int[5]; }
>   ~this() {/* can't destroy buf here */}
> }
> 
> void main()
> {
>   auto c = new C;
>   delete c; // doesn't destroy c.buf
> }
> 
> What we need is a way to hook deterministic destruction vs. GC destruction.  Only then, a SP language will you be.
> 
> -Steve


More information about the Digitalmars-d mailing list