One of the common problems of destructors is that they cannot assume any
of their GC-allocated resources are valid when inside the destrutor.
The spec says:
The garbage collector is not guaranteed to run the destructor for all
unreferenced objects. Furthermore, the order in which the garbage
On 2010-08-10 14:25:48 -0400, "Steven Schveighoffer"
said:
~this(bool deterministic)
{
if(deterministic) file.close();
}
or like this:
~this()
{
}
Scope classes (if allowed to exist) or calls to clear will set
deterministic to true. The GC will set it to false.
This would make dest
Steven Schveighoffer Wrote:
> One of the common problems of destructors is that they cannot assume any
> of their GC-allocated resources are valid when inside the destrutor.
Just a note. It's already possible to do this in D2 using an interface.
Here's a thread about it:
http://www.digitalm
Am 10.08.2010 20:25, schrieb Steven Schveighoffer:
One of the common problems of destructors is that they cannot assume any
of their GC-allocated resources are valid when inside the destrutor.
The spec says:
The garbage collector is not guaranteed to run the destructor for all
unreferenced obje
On Tue, 10 Aug 2010 14:56:54 -0400, Mafi wrote:
Am 10.08.2010 20:25, schrieb Steven Schveighoffer:
One of the common problems of destructors is that they cannot assume any
of their GC-allocated resources are valid when inside the destrutor.
The spec says:
The garbage collector is not guarant
On Tue, 10 Aug 2010 14:51:56 -0400, Sean Kelly
wrote:
Steven Schveighoffer Wrote:
One of the common problems of destructors is that they cannot assume any
of their GC-allocated resources are valid when inside the destrutor.
Just a note. It's already possible to do this in D2 using an
i
Steven Schveighoffer wrote:
...
> This would make destructors a lot more useful. Thoughts?
>
> -Steve
My first thought was that they are actually two separate functions
distinguished
by a boolean, then Michel also mentioned the SafeD argument.
atm I think it is better to let go of the destru
On Tue, 10 Aug 2010 14:38:13 -0400, Michel Fortin
wrote:
On 2010-08-10 14:25:48 -0400, "Steven Schveighoffer"
said:
~this(bool deterministic)
{
if(deterministic) file.close();
}
or like this:
~this()
{
}
Scope classes (if allowed to exist) or calls to clear will set
determinist
On Tue, 10 Aug 2010 15:08:30 -0400, Lutger
wrote:
Steven Schveighoffer wrote:
...
This would make destructors a lot more useful. Thoughts?
-Steve
My first thought was that they are actually two separate functions
distinguished
by a boolean, then Michel also mentioned the SafeD argumen
Thanks for this Sean. Although I concur with Steve that it looks weird, at
least is usable.
Yao G.
On Tue, 10 Aug 2010 13:51:56 -0500, Sean Kelly
wrote:
Steven Schveighoffer Wrote:
One of the common problems of destructors is that they cannot assume any
of their GC-allocated resources
Steven Schveighoffer wrote:
> On Tue, 10 Aug 2010 15:08:30 -0400, Lutger
> wrote:
>
>> Steven Schveighoffer wrote:
>> ...
>>> This would make destructors a lot more useful. Thoughts?
>>>
>>> -Steve
>>
>> My first thought was that they are actually two separate functions
>> distinguished
>> by a
That hook was really added for other purposes anyway. I mostly wanted to note
that it's possible to try this out now without any language changes.
Yao G. Wrote:
> Thanks for this Sean. Although I concur with Steve that it looks weird, at
> least is usable.
>
> Yao G.
>
>
> On Tue, 10 Aug 2
On Tue, 10 Aug 2010 16:03:42 -0400, Lutger
wrote:
Steven Schveighoffer wrote:
On Tue, 10 Aug 2010 15:08:30 -0400, Lutger
wrote:
Steven Schveighoffer wrote:
...
This would make destructors a lot more useful. Thoughts?
-Steve
My first thought was that they are actually two separate
13 matches
Mail list logo