Re: crystal clear()

2010-09-18 Thread Vladimir Panteleev
On Sat, 18 Sep 2010 00:33:11 +0300, Andrei Alexandrescu wrote: That's a great point. So we're in good shape: we leave the object in a well-defined state that allocates no resources and is distinguished from all valid states. By the way, what would be the problem with making "delete" do t

Re: crystal clear()

2010-09-18 Thread Sean Kelly
Andrei Alexandrescu Wrote: > On 09/17/2010 05:30 PM, Sean Kelly wrote: > > Steven Schveighoffer Wrote: > >> > >> But here is a legitimate question, how do we get the interfaces? There's > >> no indication in the ABI of where the interfaces are. I know from logic > >> that they must be before the

Re: crystal clear()

2010-09-17 Thread Sean Kelly
Steven Schveighoffer Wrote: > On Fri, 17 Sep 2010 18:31:45 -0400, Sean Kelly > wrote: > > > > Is there some reason clear() can't just call rt_finalize? > > does rt_finalize not deallocate the memory? If so, that's probably the > right thing to do. In fact, I think it does exactly what we w

Re: crystal clear()

2010-09-17 Thread Andrei Alexandrescu
On 09/17/2010 05:30 PM, Sean Kelly wrote: Steven Schveighoffer Wrote: But here is a legitimate question, how do we get the interfaces? There's no indication in the ABI of where the interfaces are. I know from logic that they must be before the data members. But logic also says that interface

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:31:45 -0400, Sean Kelly wrote: Steven Schveighoffer Wrote: On Fri, 17 Sep 2010 18:11:11 -0400, Steven Schveighoffer wrote: > On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu > wrote: > >> On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: >>> On Fri, 17 Sep

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:30:35 -0400, Sean Kelly wrote: Steven Schveighoffer Wrote: But here is a legitimate question, how do we get the interfaces? There's no indication in the ABI of where the interfaces are. I know from logic that they must be before the data members. But logic also

Re: crystal clear()

2010-09-17 Thread Sean Kelly
Steven Schveighoffer Wrote: > On Fri, 17 Sep 2010 18:11:11 -0400, Steven Schveighoffer > wrote: > > > On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu > > wrote: > > > >> On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: > >>> On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu

Re: crystal clear()

2010-09-17 Thread Sean Kelly
Steven Schveighoffer Wrote: > > But here is a legitimate question, how do we get the interfaces? There's > no indication in the ABI of where the interfaces are. I know from logic > that they must be before the data members. But logic also says that > interfaces defined by the derived type

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:18:00 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:15:58 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:11:11 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu wrote: On 09/17/2010 04:55 PM,

Re: crystal clear()

2010-09-17 Thread Sean Kelly
Steven Schveighoffer Wrote: > > Is there a map somewhere of what the hidden data in an object looks like? The ABI :-)

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:11:11 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu wrote: On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:15:58 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:11:11 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu wrote: On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, And

Re: crystal clear()

2010-09-17 Thread Sean Kelly
Andrei Alexandrescu Wrote: > On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: > > On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu > > wrote: > > > >> I think clear() can be fixed if we remove the call to the constructor > >> AND obliterate the vptr. > > > > agreed. > > One more thing:

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:11:11 -0400, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu wrote: On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 18:07:54 -0400, Andrei Alexandrescu wrote: On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove the call to the constructor AND obliterate the vptr. agreed. One

Re: crystal clear()

2010-09-17 Thread Andrei Alexandrescu
On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove the call to the constructor AND obliterate the vptr. agreed. One more thing: we need to change the call to the destructor to check t

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 17:59:15 -0400, Andrei Alexandrescu wrote: On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove the call to the constructor AND obliterate the vptr. agreed. In f

Re: crystal clear()

2010-09-17 Thread Andrei Alexandrescu
On 09/17/2010 04:55 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove the call to the constructor AND obliterate the vptr. agreed. In fact ideally we'd obliterate all vptrs of the object, which might be

Re: crystal clear()

2010-09-17 Thread Steven Schveighoffer
On Fri, 17 Sep 2010 17:33:11 -0400, Andrei Alexandrescu wrote: I think clear() can be fixed if we remove the call to the constructor AND obliterate the vptr. agreed. In fact ideally we'd obliterate all vptrs of the object, which might be tricky. Ideas? There's only one vptr, no? -Ste

crystal clear()

2010-09-17 Thread Andrei Alexandrescu
Continuing discussion regarding clear() from thread "QtD is suspended" in digitalmars.D.announce. On 09/17/2010 12:01 PM, Steven Schveighoffer wrote: On Fri, 17 Sep 2010 12:39:06 -0400, Andrei Alexandrescu wrote: On 09/17/2010 09:02 AM, Max Samukha wrote: One example is the semantics of c