A better name than Hashable (inexact) and Map (misses the -able
prefix) would be much appreciated.
--
EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
A flower falls, even though we love it; and a weed grows, even though we do
not love it. --Dogen
A better name than Hashable (inexact) and Map (misses the -able
prefix) would be much appreciated.
Indexable?
martin
--
EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
A flower falls, even though we love it; and a weed grows, even though we do
not love it. --Dogen
the point is that a Map(temporary name) object can look like ruby's
Hashes, but have a much different implementation (say, some kind of
tree), and hashing defines a specific behaviour. Dictionary may be
another one, but still ugly to me.
路路路
il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> ha scritto::
Map or Dictionary are the only real choices, AFAIC. I really like Map
as a name here.
Gavin
路路路
On Thursday, June 17, 2004, 11:03:28 PM, gabriele wrote:
il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> > ha scritto::
HashEnabled?
the point is that a Map(temporary name) object can look like ruby's
Hashes, but have a much different implementation (say, some kind of
tree), and hashing defines a specific behaviour. Dictionary may be
another one, but still ugly to me.
well, what are the 'requirements'? O(1) lookup, insertion and deletion? key
-> value lookup? etc. if it's mapping keys to values, then that could be
called mapping or hashing i suppose. what about something involving 'key' and
'value'? or something using indexable with a refinement for things indexable
by number, or by any object? map may be the best work to describe this
behaviour...
-a
路路路
On Thu, 17 Jun 2004, gabriele renzi wrote:
il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> > ha scritto::
HashEnabled?
the point is that a Map(temporary name) object can look like ruby's
Hashes, but have a much different implementation (say, some kind of
tree), and hashing defines a specific behaviour. Dictionary may be
another one, but still ugly to me.
--
EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
A flower falls, even though we love it; and a weed grows, even though we do
not love it. --Dogen
the point is that a Map(temporary name) object can look like ruby's
Hashes, but have a much different implementation (say, some kind of
tree), and hashing defines a specific behaviour. Dictionary may be
another one, but still ugly to me.
PairAssociative?
Borrowed from my C++ STL book[1], which lists hash_map<> as a
model of Pair Associative Container (as well as a model of
Hashed Associative Container and Unique Associative Container).
Regards,
Bill
[1] Generic Programming and the STL, Austern, Matthew H.
Instead of the suffix -able (as in Enumerable), a -Mixin suffix is another
choice, e.g. MapMixin or HashMixin.
Regards,
Michael
路路路
On Thu, Jun 17, 2004 at 10:42:06PM +0900, Gavin Sinclair wrote:
On Thursday, June 17, 2004, 11:03:28 PM, gabriele wrote:
> il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> > > ha scritto::
>>
>>HashEnabled?
> the point is that a Map(temporary name) object can look like ruby's
> Hashes, but have a much different implementation (say, some kind of
> tree), and hashing defines a specific behaviour. Dictionary may be
> another one, but still ugly to me.
Map or Dictionary are the only real choices, AFAIC. I really like Map
as a name here.
il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> >> ha scritto::
HashEnabled?
the point is that a Map(temporary name) object can look like ruby's
Hashes, but have a much different implementation (say, some kind of
tree), and hashing defines a specific behaviour. Dictionary may be
another one, but still ugly to me.
PairAssociative?
Borrowed from my C++ STL book[1], which lists hash_map<> as a
model of Pair Associative Container (as well as a model of
Hashed Associative Container and Unique Associative Container).
"Ara.T.Howard" <ahoward@noaa.gov> wrote in message news:<Pine.LNX.4.60.0406170934300.31212@harp.ngdc.noaa.gov>...
well, what are the 'requirements'? O(1) lookup, insertion and deletion? key
-> value lookup? etc. if it's mapping keys to values, then that could be
called mapping or hashing i suppose.
from the rcr: "provide a mixin for key->value mappings"
Sorry for not have stated this more clearly, but this mixin, in my
'vision', would be going to work with any kind key->value mappers, say
dbm/sdbm/gdbm/pstore/rbtree, and even stuff like Dict servers, LDAP
directories, or wikipedia.
The point that classes may be using some kind of hashing internally is
just an implementation detail. But, as I said, it's my fault to have
written such a misleading title. It was hard to fill all that blank
fields in the rcr page.
what about something involving 'key' and
'value'? or something using indexable with a refinement for things indexable
by number, or by any object? map may be the best work to describe this
behaviour...
Interesting, I like the idea of micro interfaces/mixin and fine
grained refinements, but it's up to matz to decide.
<plug>
And, btw, if somebody like this, please take two minutes to vote at
rcrchive.net
</plug>
Boost (a collection of C++ template libraries) works with tupels
rather than with pairs.
In Smalltalk there is a Collection class named KeyedCollection but
Array is an ArrayedCollection, the latter a subclass of
SequenceableCollection. Dictionary is a Subclass of Set.
IdentityDictionary is not a subclass of Dictionary. I don't want to
discuss Smalltalk's single inheritance. I just want to point out that
there are a lot of koncepts to take into account.
- fixed order (sorted keys) vs.
variable order (may change sort function) vs.
no order (hashed keys)
- fixed type keys vs.
arbitrary but constant type vs.
mixable types
- access by keys in constant time?
- allow dublicated values?
- how to cope with equal but not identical keys?
- fixed size or growable?
This list is not complete, I just did some brainstorming.
I think an appropriate name will come up when decision about the
interface is complete.
Cheers
Sascha
路路路
"Bill Kelly" <billk@cts.com> wrote:
Borrowed from my C++ STL book[1], which lists hash_map<> as a
model of Pair Associative Container (as well as a model of
Hashed Associative Container and Unique Associative Container).
On Thu, Jun 17, 2004 at 10:42:06PM +0900, Gavin Sinclair wrote:
On Thursday, June 17, 2004, 11:03:28 PM, gabriele wrote:
il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> >>>ha scritto::
HashEnabled?
the point is that a Map(temporary name) object can look like ruby's
Hashes, but have a much different implementation (say, some kind of
tree), and hashing defines a specific behaviour. Dictionary may be
another one, but still ugly to me.
Map or Dictionary are the only real choices, AFAIC. I really like Map
as a name here.
Instead of the suffix -able (as in Enumerable), a -Mixin suffix is another
choice, e.g. MapMixin or HashMixin.
Or MapMethods and/or HashMethods.
It reads nicely ...
class Dictionary
include MapMethods
....
end
--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
Yes, I like it. That sound much more natural and tells what's actually
doing (including methods related to mapping).
Regards,
Michael
路路路
On Fri, Jun 18, 2004 at 07:01:59AM +0900, Jim Weirich wrote:
Michael Neumann wrote:
>On Thu, Jun 17, 2004 at 10:42:06PM +0900, Gavin Sinclair wrote:
>
>>On Thursday, June 17, 2004, 11:03:28 PM, gabriele wrote:
>>
>>
>>>il Thu, 17 Jun 2004 06:27:25 -0600, "Ara.T.Howard" <ahoward@noaa.gov> > >>>ha scritto::
>>
>>>>HashEnabled?
>>
>>>the point is that a Map(temporary name) object can look like ruby's
>>>Hashes, but have a much different implementation (say, some kind of
>>>tree), and hashing defines a specific behaviour. Dictionary may be
>>>another one, but still ugly to me.
>>
>>Map or Dictionary are the only real choices, AFAIC. I really like Map
>>as a name here.
>
>
>Instead of the suffix -able (as in Enumerable), a -Mixin suffix is another
>choice, e.g. MapMixin or HashMixin.