|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
digitalmars.D.dtl - "map": sorted or unsorted?
Before the vocabulary gets too confusing, should 1) we try to use the word "map" in D to mean an STL-like map (ie sorted) or 2) have "map" mean a Java-like Map (not necessarily sorted) or 3) always use "sorted map" and "unsorted map" or 4) ignore the difference and let the context determine which is meant. I ask because in MinTL a Map is sorted and in DTL it is unsorted. I'm tempted to rename the MinTL Map to SortedMap. Thoughts? -Ben ps - I say "STL-like" and "Java-like" out of ignorance of any other programming language out there that has sorted and/or unsorted maps. Aug 02 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cemuln$kv2$1 digitaldaemon.com...Before the vocabulary gets too confusing, should 1) we try to use the word "map" in D to mean an STL-like map (ie sorted) or 2) have "map" mean a Java-like Map (not necessarily sorted) or Aug 02 2004
FWIW, I think a Map should perhaps be somewhat abstract. Therefore a sorted version would be considered a specialization? I think SortedMap would be a better name for the sorted version. There again, I'm a firm believer in splitting a class into it's respective mutable and immutable versions (where feasible) ... so go figure :-) "Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cemuln$kv2$1 digitaldaemon.com...Before the vocabulary gets too confusing, should 1) we try to use the word "map" in D to mean an STL-like map (ie sorted) Aug 02 2004
Ben Hinkle wrote:Before the vocabulary gets too confusing, should 1) we try to use the word "map" in D to mean an STL-like map (ie sorted) or 2) have "map" mean a Java-like Map (not necessarily sorted) or 3) always use "sorted map" and "unsorted map" or 4) ignore the difference and let the context determine which is meant. I ask because in MinTL a Map is sorted and in DTL it is unsorted. I'm tempted to rename the MinTL Map to SortedMap. Thoughts? -Ben ps - I say "STL-like" and "Java-like" out of ignorance of any other programming language out there that has sorted and/or unsorted maps. Aug 02 2004
In article <cemuln$kv2$1 digitaldaemon.com>, Ben Hinkle says...Before the vocabulary gets too confusing, should 1) we try to use the word "map" in D to mean an STL-like map (ie sorted) or 2) have "map" mean a Java-like Map (not necessarily sorted) or 3) always use "sorted map" and "unsorted map" or 4) ignore the difference and let the context determine which is meant. Aug 02 2004
Ben Hinkle wrote:Before the vocabulary gets too confusing, should 1) we try to use the word "map" in D to mean an STL-like map (ie sorted) or 2) have "map" mean a Java-like Map (not necessarily sorted) or 3) always use "sorted map" and "unsorted map" or 4) ignore the difference and let the context determine which is meant. I ask because in MinTL a Map is sorted and in DTL it is unsorted. I'm tempted to rename the MinTL Map to SortedMap. Thoughts? -Ben ps - I say "STL-like" and "Java-like" out of ignorance of any other programming language out there that has sorted and/or unsorted maps. Aug 03 2004
|