January 26, 2005 Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | "Jarrett Billingsley" wrote:
>> b.delete("hello");
> I think this would be the most logical syntax,
[...]
Sometimes first thoughts have best results and your choice points into the same direction as matthews `remove' property. But I dislike both:
Against `delete' holds, that it is a keyword and something pertubates me to put it in a row with non-keywords as the names of the other properties are.
Against `remove' holds, that it is a synonym of delete and therefore at every occurence of delete or remove the writer is required to clarify which of both words must be choosen, thereby complicating the writing unnecessarily.
So I dare for `toggle' like I did in another branch of this thread.
This word circumvents both arguments given above and furthermore yields an explicit notion for the insertion of a key into an associative array, which is currently not present.
Remark: currently I use `b["hello"]= b["hello"]' to make clear that an insertion is an intentionally one.
The return value might be the same as suggested in the other branch: `true' if the key exists in the AA after the operation and `false' otherwise.
Then an insertion for a key for which its presence in the AA is unknown would look like:
(! key in aa) && aa.toggle= key;
and a deletion
key in aa && aa.toggle= key;
Remark: the parentheses at the insertion seem superfluous but the compiler generates a "found '!' instead of statement" error if omitted.
-manfred
|
January 26, 2005 Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | "Manfred Nowak" <svv1999@hotmail.com> wrote in message news:ct6tvo$6sr$1@digitaldaemon.com... > "Jarrett Billingsley" wrote: > >>> b.delete("hello"); >> I think this would be the most logical syntax, > [...] > > Sometimes first thoughts have best results and your choice points into > the > same direction as matthews `remove' property. But I dislike both: > > Against `delete' holds, that it is a keyword and something pertubates > me to > put it in a row with non-keywords as the names of the other properties > are. > > Against `remove' holds, that it is a synonym of delete and therefore > at > every occurence of delete or remove the writer is required to clarify > which > of both words must be choosen, thereby complicating the writing > unnecessarily. > > So I dare for `toggle' like I did in another branch of this thread. > > This word circumvents both arguments given above and furthermore > yields an > explicit notion for the insertion of a key into an associative array, > which > is currently not present. > > Remark: currently I use `b["hello"]= b["hello"]' to make clear that an insertion is an intentionally one. > > The return value might be the same as suggested in the other branch: `true' if the key exists in the AA after the operation and `false' otherwise. > > Then an insertion for a key for which its presence in the AA is > unknown > would look like: > > (! key in aa) && aa.toggle= key; > > and a deletion > > key in aa && aa.toggle= key; > > Remark: the parentheses at the insertion seem superfluous but the > compiler > generates a "found '!' instead of statement" error if omitted. Manfred, I must surmise that you are privvy to a deeper wisdom than I, for I cannot fathom any meaning, never mind sense, in all the foregoing. Maybe it's a language thing, but to me 'remove' and 'delete' have unequivocal and distinct meanings. The former takes something out of the thing on which the remove() is called. The latter destroys/kills/expunges the thing it is told to delete. I certainly grant that there is midunderstanding in, say, C++ with the misuse of clear() and empty(), but I don't think that extends to 'remove' and 'delete', at least as far as English-speaking C++ heads (who are me <g>) are concerned. :-) |
January 26, 2005 [OT] Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | "Matthew" wrote:
[...]
> Maybe it's a language thing
[...]
I am sure that there exists a view under which the words `delete' and `remove' are totally different. But why did you immediately suggest this replacement for `delete', when they are so different?
And why lists the online available Roget's New Millennium Thesaurus (First Edition (v 1.1.1), Copyright © 2005 by Lexico Publishing Group, LLC. All rights reserved.) about ten main entry synonyma, that include both words, yielding about 200 sub entries:
abate, abolish, abort, abrogate, abstract, amputate, annihilate, annul, ax, batter, black, black out, blank, bleep, blot, blot out, blow down, blue pencil, blue ruin, bomb, break, break down, break off, bulldoze, call off, cancel, capsize, carry away, carry off, cart off, carve, cast down, cease, chuck, clean, clean up, clear away, countermand, crash, cross out, cut, cut off, cut out, cut up, decimate, decontaminate, deface, dele, delete, demolish, depose, destroy, detach, dethrone, dig out, disannul, discard, discharge, dislodge, dismiss, dispatch, displace, disturb, do in, doff, drop, dynamite, edit, efface, eject, elide, eliminate, eradicate, erase, evacuate, excise, exclude, expel, expunge, exscind, exsect, exterminate, extinguish, extirpate, extract, fell, finish off, give up, gut, junk, kayo, kill, knock down, knock off, knock out, KO, launder, level, lop off, massacre, mow down, negate, nix, nullify, obliterate, off, omit, oust, overthrow, overturn, pass up, pull down, pull out, purge, quash, raise, raze, reduce, refrain from, relegate, remove, render invalid, repeal, repudiate, rescind, resect, revoke, rip out, root out, rub, rub out, ruin, rule out, sanitize, scatter, scissor out, scratch out, scrub, separate, sever, shed, ship, sink, skim, slash, slaughter, slay, smash, snip, spill, squash, squelch, stamp across, stamp out, sterilize, stop, strike, strike out, subvert, supersede, supplant, take down, take out, tear down, tear out, tear up, throw down, throw out, topple, torpedo, total, transfer, transport, trash, trim, unbuild, undo, unload, unmake, unseat, uproot, upset, usurp, wash out, wipe out, withdraw, wrack, wreck, x out, z, zap
Its up to you to show, that these about 20,000 possible word pairs are different under every possible view. Have fun and please post the answer from Roget.
-manfred
|
January 26, 2005 Re: [OT] Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | "Manfred Nowak" <svv1999@hotmail.com> wrote in message news:ct79lc$lvl$1@digitaldaemon.com... > "Matthew" wrote: > > [...] >> Maybe it's a language thing > [...] > > I am sure that there exists a view under which the words `delete' and > `remove' are totally different. But why did you immediately suggest > this > replacement for `delete', when they are so different? Using delete to _remove_ an element from an aa is a misnomer - that's kind of the point of this whole thread, I thought! - so there's not only no way I would/should/could demonstrate that it's the same, there'd be no point. Sigh. > > And why lists the online available Roget's New Millennium Thesaurus (First Edition (v 1.1.1), Copyright © 2005 by Lexico Publishing Group, LLC. All rights reserved.) about ten main entry synonyma, that include both words, yielding about 200 sub entries: > > abate, abolish, abort, abrogate, abstract, amputate, annihilate, > annul, > ax, batter, black, black out, blank, bleep, blot, blot out, blow down, > blue pencil, blue ruin, bomb, break, break down, break off, bulldoze, > call off, cancel, capsize, carry away, carry off, cart off, carve, > cast > down, cease, chuck, clean, clean up, clear away, countermand, crash, > cross out, cut, cut off, cut out, cut up, decimate, decontaminate, > deface, dele, delete, demolish, depose, destroy, detach, dethrone, dig > out, disannul, discard, discharge, dislodge, dismiss, dispatch, > displace, > disturb, do in, doff, drop, dynamite, edit, efface, eject, elide, > eliminate, eradicate, erase, evacuate, excise, exclude, expel, > expunge, > exscind, exsect, exterminate, extinguish, extirpate, extract, fell, > finish off, give up, gut, junk, kayo, kill, knock down, knock off, > knock > out, KO, launder, level, lop off, massacre, mow down, negate, nix, > nullify, obliterate, off, omit, oust, overthrow, overturn, pass up, > pull > down, pull out, purge, quash, raise, raze, reduce, refrain from, > relegate, remove, render invalid, repeal, repudiate, rescind, resect, > revoke, rip out, root out, rub, rub out, ruin, rule out, sanitize, > scatter, scissor out, scratch out, scrub, separate, sever, shed, ship, > sink, skim, slash, slaughter, slay, smash, snip, spill, squash, > squelch, > stamp across, stamp out, sterilize, stop, strike, strike out, subvert, > supersede, supplant, take down, take out, tear down, tear out, tear > up, > throw down, throw out, topple, torpedo, total, transfer, transport, > trash, trim, unbuild, undo, unload, unmake, unseat, uproot, upset, > usurp, > wash out, wipe out, withdraw, wrack, wreck, x out, z, zap > > Its up to you to show, that these about 20,000 possible word pairs are > different under every possible view. Have fun and please post the > answer > from Roget. > > -manfred > |
January 26, 2005 Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | Matthew wrote:
>
> "Manfred Nowak" <svv1999@hotmail.com> wrote in message news:ct6tvo$6sr$1@digitaldaemon.com...
>> "Jarrett Billingsley" wrote:
>>
>>>> b.delete("hello");
>>> I think this would be the most logical syntax,
>> [...]
>>
>> Sometimes first thoughts have best results and your choice points into
>> the
>> same direction as matthews `remove' property. But I dislike both:
>>
>> Against `delete' holds, that it is a keyword and something pertubates
>> me to
>> put it in a row with non-keywords as the names of the other properties
>> are.
>>
>> Against `remove' holds, that it is a synonym of delete and therefore
>> at
>> every occurence of delete or remove the writer is required to clarify
>> which
>> of both words must be choosen, thereby complicating the writing
>> unnecessarily.
>>
>> So I dare for `toggle' like I did in another branch of this thread.
>>
>> This word circumvents both arguments given above and furthermore
>> yields an
>> explicit notion for the insertion of a key into an associative array,
>> which
>> is currently not present.
>>
>> Remark: currently I use `b["hello"]= b["hello"]' to make clear that an insertion is an intentionally one.
>>
>> The return value might be the same as suggested in the other branch: `true' if the key exists in the AA after the operation and `false' otherwise.
>>
>> Then an insertion for a key for which its presence in the AA is
>> unknown
>> would look like:
>>
>> (! key in aa) && aa.toggle= key;
>>
>> and a deletion
>>
>> key in aa && aa.toggle= key;
>>
>> Remark: the parentheses at the insertion seem superfluous but the
>> compiler
>> generates a "found '!' instead of statement" error if omitted.
>
> Manfred, I must surmise that you are privvy to a deeper wisdom than I, for I cannot fathom any meaning, never mind sense, in all the foregoing.
>
> Maybe it's a language thing, but to me 'remove' and 'delete' have unequivocal and distinct meanings. The former takes something out of the thing on which the remove() is called. The latter destroys/kills/expunges the thing it is told to delete. I certainly grant that there is midunderstanding in, say, C++ with the misuse of clear() and empty(), but I don't think that extends to 'remove' and 'delete', at least as far as English-speaking C++ heads (who are me <g>) are concerned.
I can only agree on this. There is a clear conceptual distinction between 'deleting' an object (i.e. ending its existance) and 'removing' an item from a list (where the item might still be referenced elsewhere or might be of a value type that does not even have an 'existance' like an object on the heap.)
As to using a thesaurus: such a list of words is *not* a list of indistinguishable synonyms, but one of similar words that may be exchangable in one context but have a completely different meaning in another one.
|
January 26, 2005 Re: [OT][Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | "Matthew" wrote: [...] > Using delete to _remove_ an element from an aa is a misnomer - that's kind of the point of this whole thread, I thought! [...] Now I see your point. With http://dict.leo.org I tried to find a word in my native language that is closest to both ... and found two: "entfernen" which in our context means "take away to somewhere" and "beseitigen" which means "take away to nowhere". 1) In our context the word to be choosen in german should then be "beseitigen", because the reurn value of `delete' operation is `void' 2) Without our context I would translate "remove" to "entfernen", which would render "remove" unfounded ... in contradiction to your opinion. 3) There is a third word in the translations of "beseitigen" and "entfernen": "eliminate". Is this word a compromise :-) However to me with english as second language the choosen word is of minor interest as long as there are no two words in the programming language which have approximately the same meaning in the natural language and for someone who does not speak english at all, only the orthographic distance is of interest. -manfred |
January 26, 2005 Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Norbert Nemec | Norbert Nemec wrote:
[...]
> There is a clear conceptual distinction
> between 'deleting' an object (i.e. ending its existance) and
> 'removing' an item from a list (where the item might still be
> referenced elsewhere or might be of a value type that does not
> even have an 'existance' like an object on the heap.)
Agreed. But
1) according to my available dictionaries `delete' is a technical term
whereas "remove" is not.
2) Moving implies the existence of the object operated on and a change
in the location at the end of that operation as well. Both is not true
in the context we argument on.
3) From any view far enough every discussion becomes trivial. Which is
undoubtly true for programmers unaware of the english language.
4) because of 3): if any word is choosen for the elimination only of an
object from an AA for the reason of symmetry another word for the
creation only must be choosen also --- and learned from every D-
programmer.
5) The requirement of 4) is annuled by one combining both: toggle.
-manfred
|
January 27, 2005 Re: [Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | Manfred Nowak wrote: > 1) according to my available dictionaries `delete' is a technical term whereas "remove" is not. What qualifies a "technical term"? Twenty years back, "Window" was not a technical term and still someone decided to use it for something technical. > 2) Moving implies the existence of the object operated on and a change in the location at the end of that operation as well. Both is not true in the context we argument on. If you have a associative array of object references this is not too far from the truth. The reference is removed, the object might still survive if it is referenced from somewhere else. "delete" on the other hand really extinguishes the object itself. > 3) From any view far enough every discussion becomes trivial. Which is undoubtly true for programmers unaware of the english language. I might not be a native speaker, but I trust myself at least some of the subtleties of the English language. I love the english language for its expressiveness, especially when it comes to finding a single word for an operation (like in this case) In any case, though, you cannot avoid that D is a different language than English. We can try to come close so that learning is simplified by intuition, but the exact meaning of a word will still have to be learned. > 4) because of 3): if any word is choosen for the elimination only of an object from an AA for the reason of symmetry another word for the creation only must be choosen also --- and learned from every D- programmer. You have the assignment to put objects into an AA. I don't feel that there is any special "asymmetry" here. All over D, creation and annihilation are never symmetric towards each other. Objects, for example, are usually not deleted at all but just dropped to the floor for the GC to clean up. > 5) The requirement of 4) is annuled by one combining both: toggle. "toggle" sounds like an operation for a two-state switch. If you have a collection of objects this word sounds rather strange to me. Have you ever toggled an apple into a basket or out of it? |
January 27, 2005 Re: [OT][Confusion] delete is an operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | Manfred Nowak wrote: > "Matthew" wrote: > > [...] >> Using delete to _remove_ an element from an aa is a misnomer - that's kind of the point of this whole thread, I thought! > [...] > > Now I see your point. With http://dict.leo.org I tried to find a word in my native language that is closest to both ... and found two: "entfernen" which in our context means "take away to somewhere" and "beseitigen" which means "take away to nowhere". > > 1) In our context the word to be choosen in german should then be "beseitigen", because the reurn value of `delete' operation is `void' 2) Without our context I would translate "remove" to "entfernen", which would render "remove" unfounded ... in contradiction to your opinion. 3) There is a third word in the translations of "beseitigen" and "entfernen": "eliminate". Is this word a compromise :-) This is exactly the key point: an AA is a collection, so objects are removed from it ("entfernt", "herausgenommen"). If another reference to the same object still exists, the object is *not* extinguished. This is in clear contrast to the "delete" operation on object references. The object itself is eliminated, purged from existance or whatever you want to call it. > However to me with english as second language the choosen word is of minor interest as long as there are no two words in the programming language which have approximately the same meaning in the natural language and for someone who does not speak english at all, only the orthographic distance is of interest. Very true. The words should help the intuition, but in the end, it is up to the language to actually define their meaning. |
Copyright © 1999-2021 by the D Language Foundation