W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2008

[whatwg] WebIDL vs HTML5 storage changes

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 19 May 2008 20:55:42 -0700
Message-ID: <7D47812B-BC7A-4A4A-AE47-A8266306018B@apple.com>

On May 19, 2008, at 4:52 PM, Brady Eidson wrote:

>> To give you an analogy, even in C++, where you're allowed to  
>> overload operator delete, if you overloaded operator delete to mean  
>> "do not free this object's memory, but do delete the file it  
>> references from the file system", well, let's just say that your  
>> patch would not pass code review with any of your four reviewers :).
> But if you overloaded the delete operator to free the object's  
> memory *and* delete its referenced files from the file system, you'd  
> be using the operator overloading in its intended capacity.

I think the analogy between delete in C++ and delete in JavaScript is  
strained. First of all, the two delete operators do totally different  
things. Second, C++ supports general operator overloading for nearly  
every operator. The right analogy would be removing objects from  
collections, and C++ does not have a special operator for that.

(But as a side note I think it would be poor style for C++ code to  
overload operator delete to remove files from the filesystem. The  
right place to do additional resource management would be the  

I do agree that the spec should define a single interoperable behavior  
and we should all converge.

Received on Monday, 19 May 2008 20:55:42 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:02 UTC