Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-09 Thread Daniel Olegovich Lazarenko
>> "Pure OOP style is always the right way" Sorry, that's a typo, I meant "not always" of course. The examples clarify that. My point was that "release", "take" and "move" have well-established and different meanings (with connotations that may or may not be logical without the same background): *

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-07 Thread Darin Adler
> On Sep 7, 2016, at 1:57 AM, Maciej Stachowiak wrote: > > perhaps a syntax like Ref x = notNull(move(refPtr)) could be made to work It definitely can. — Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/li

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-07 Thread Maciej Stachowiak
> On Sep 6, 2016, at 8:20 PM, Darin Adler wrote: > >> On Sep 6, 2016, at 6:43 PM, Maciej Stachowiak wrote: >> >> RefPtr does also have regular release() though. I'm not sure if this is for >> a practical reason or just no one has fixed it yet. > > It’s still around until we finish getting ri

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Darin Adler
> On Sep 6, 2016, at 6:43 PM, Maciej Stachowiak wrote: > > RefPtr does also have regular release() though. I'm not sure if this is for a > practical reason or just no one has fixed it yet. It’s still around until we finish getting rid of PassRefPtr, that’s all. > A wacky solution, based on you

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Maciej Stachowiak
> On Sep 6, 2016, at 5:27 PM, Darin Adler wrote: > >> On Sep 6, 2016, at 4:48 PM, Maciej Stachowiak wrote: >> >> STL smart pointers have a 0-argument reset for non-returning remove instead, >> and convention seems to be to use swap() or move() for the returning remove >> on a smart pointer.

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Darin Adler
> On Sep 6, 2016, at 4:48 PM, Maciej Stachowiak wrote: > > STL smart pointers have a 0-argument reset for non-returning remove instead, > and convention seems to be to use swap() or move() for the returning remove > on a smart pointer. So an alternate possibility would be to use the above > co

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Maciej Stachowiak
I thought about why release() seems subtly wrong to me for collections, but not for smart pointers. Specifically, release() puts the focus on giving up ownership, but the in the case of a collection, the most important thing is removal from the collection, where giving up ownership is a detail

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Michael Catanzaro
On Tue, 2016-09-06 at 11:12 -0700, Filip Pizlo wrote: > FWIW, I still like release() better than move().  a = move(b) is a > command to the system to move b to a.  So, value = > collection.move(key) feels like a command to the collection to move > key to value, which is clearly not what is going on

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Alex Christensen
I think “take" is a fine word to indicate that you are taking a value from a HashSet, just like “add" indicates you are adding to the set and remove indicates you are “removing" from the set. It’s true that in all these cases the caller is doing the thing, not the object, but it makes sense in

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Filip Pizlo
> On Sep 6, 2016, at 11:07 AM, Geoffrey Garen wrote: > > “take” grinds my gears too — though I’ve gotten used to it, more or less. > > I read “object.verb()” as a command, “verb”, directed at “object” (or > sometimes as a question, “verb?”, directed at “object”). I think most APIs > are phras

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Geoffrey Garen
“take” grinds my gears too — though I’ve gotten used to it, more or less. I read “object.verb()” as a command, “verb”, directed at “object” (or sometimes as a question, “verb?”, directed at “object”). I think most APIs are phrased this way. And if I were Antonin Scalia, I would make the original

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Alfonso Guerra
On Tue, Sep 6, 2016 at 4:29 AM, Daniel Olegovich Lazarenko < dani...@opera.com> wrote: .. > * "take" - a typical name for collections like a blocking queue, heap and > some others (usually ordered). If it's a collection's method, it's > logically expected to return an item. The key distinction b

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Michael Catanzaro
On Mon, 2016-09-05 at 10:23 -0700, Filip Pizlo wrote: > The use of "take" for these methods grinds my gears, for the same > reason you were distracted: "take" describes the desires of the > caller, but that doesn't work for me because I read > "fred.makeCoffee()" as "makeCoffee()" being an imperati

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-06 Thread Daniel Olegovich Lazarenko
t; Today's Topics: > >1. Terminology for giving up ownership: take, release, move > (Darin Adler) >2. Re: Terminology for giving up ownership: take, release, move > (Filip Pizlo) > > > -------------- > > Message: 1 > Date: Mon, 05 Sep 2016 10:13:28 -0700

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Alfonso Guerra
Is it imperative to restrict the choices to the current nomenclature? If you're finding it difficult to pick from among them, perhaps a glance through Dictionary's thesaurus will help. Something like cede, yield, or relinquish? and for the counterpart perhaps manage, contain, hold or another synon

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Maciej Stachowiak
> On Sep 5, 2016, at 3:30 PM, Dan Bernstein wrote: > >> >> On Sep 5, 2016, at 10:13 AM, Darin Adler wrote: >> >> Hi folks. >> >> WebKit has some critical functions that involve asking an object to give up >> ownership of something so the caller can take ownership. >> >> In the C++ standard

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Dan Bernstein
> On Sep 5, 2016, at 10:13 AM, Darin Adler wrote: > > Hi folks. > > WebKit has some critical functions that involve asking an object to give up > ownership of something so the caller can take ownership. > > In the C++ standard library itself, this is called move, as in std::move. > > In WebK

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Maciej Stachowiak
> On Sep 5, 2016, at 3:18 PM, Ryosuke Niwa wrote: > > On Mon, Sep 5, 2016 at 2:48 PM, Ryosuke Niwa > wrote: >> On Mon, Sep 5, 2016 at 2:47 PM, Filip Pizlo wrote: >>> >>> On Sep 5, 2016, at 2:35 PM, Ryosuke Niwa wrote: >>> >>> On Mon, Sep 5, 2016 at 10:13 AM, Darin A

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Ryosuke Niwa
On Mon, Sep 5, 2016 at 2:48 PM, Ryosuke Niwa wrote: > On Mon, Sep 5, 2016 at 2:47 PM, Filip Pizlo wrote: >> >> On Sep 5, 2016, at 2:35 PM, Ryosuke Niwa wrote: >> >> On Mon, Sep 5, 2016 at 10:13 AM, Darin Adler wrote: >> >> Hi folks. >> >> WebKit has some critical functions that involve asking a

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Maciej Stachowiak
> On Sep 5, 2016, at 2:35 PM, Ryosuke Niwa wrote: > > On Mon, Sep 5, 2016 at 10:13 AM, Darin Adler > wrote: >> Hi folks. >> >> WebKit has some critical functions that involve asking an object to give up >> ownership of something so the caller can take ownership. >> >>

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Maciej Stachowiak
> On Sep 5, 2016, at 10:13 AM, Darin Adler wrote: > > Hi folks. > > WebKit has some critical functions that involve asking an object to give up > ownership of something so the caller can take ownership. > > In the C++ standard library itself, this is called move, as in std::move. > > In WebK

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Ryosuke Niwa
On Mon, Sep 5, 2016 at 2:47 PM, Filip Pizlo wrote: > > On Sep 5, 2016, at 2:35 PM, Ryosuke Niwa wrote: > > On Mon, Sep 5, 2016 at 10:13 AM, Darin Adler wrote: > > Hi folks. > > WebKit has some critical functions that involve asking an object to give up > ownership of something so the caller can

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Filip Pizlo
> On Sep 5, 2016, at 2:35 PM, Ryosuke Niwa wrote: > > On Mon, Sep 5, 2016 at 10:13 AM, Darin Adler > wrote: >> Hi folks. >> >> WebKit has some critical functions that involve asking an object to give up >> ownership of something so the caller can take ownership. >> >>

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Ryosuke Niwa
On Mon, Sep 5, 2016 at 10:13 AM, Darin Adler wrote: > Hi folks. > > WebKit has some critical functions that involve asking an object to give up > ownership of something so the caller can take ownership. > > In the C++ standard library itself, this is called move, as in std::move. > > In WebKit sm

Re: [webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Filip Pizlo
> On Sep 5, 2016, at 10:13 AM, Darin Adler wrote: > > Hi folks. > > WebKit has some critical functions that involve asking an object to give up > ownership of something so the caller can take ownership. > > In the C++ standard library itself, this is called move, as in std::move. > > In WebK

[webkit-dev] Terminology for giving up ownership: take, release, move

2016-09-05 Thread Darin Adler
Hi folks. WebKit has some critical functions that involve asking an object to give up ownership of something so the caller can take ownership. In the C++ standard library itself, this is called move, as in std::move. In WebKit smart pointers, we call this operation release, as in RefPtr::relea