Re: Order of Key-Value pair ("associat ive arrays")
In article <8yf9viwq.fsf@h otpop.com>, Lasse Reichstein Nielsen
<lrn@hotpop.com > writes[color=blue]
>John G Harris <john@nospam.de mon.co.uk> writes:
>[color=green]
>> It's the other way round. Every ECMAScript object is an associative
>> array.[/color]
>
>... where "associativ e array" is just mumbo-jumbo for a mapping from
>something to something. I believe the name comes from Perl, although
>they could have taken it from somewhere else. It is really a misnomer,
>as it has nothing to do with "real" arrays.[/color]
Back in the 1960s a lot of people got very excited about associative
memory. It was, at last, possible to build one with less than a roomful
of electronics. As it happens its most common use these days is in
memory caches. These are buried inside processor chips and so are not
very visible to users.
An ordinary array is built from ordinary memory. You put in a relative
address and a value comes back very, very quickly.
An associative array is built from associative memory. You put in a key
and a value comes back also very, very quickly ... if you can afford to
use a million or so transistors. It's a lot slower if you have to use
software to do it.
Altogether, "associativ e array" is a perfectly respectable technical
term that goes back a long way. It's wrong to complain if someone uses
it.
[color=blue]
>In, e.g., Java, I would never say "associativ e array". I'd just say
>"Map".[/color]
In Java, what have Map and Dictionary got in common? They are both
associative arrays. It's not very clear if you have to say that one is a
Map and so is the other. And in C++ you can use array syntax, a[b], to
get at the values.
John
--
John Harris
In article <8yf9viwq.fsf@h otpop.com>, Lasse Reichstein Nielsen
<lrn@hotpop.com > writes[color=blue]
>John G Harris <john@nospam.de mon.co.uk> writes:
>[color=green]
>> It's the other way round. Every ECMAScript object is an associative
>> array.[/color]
>
>... where "associativ e array" is just mumbo-jumbo for a mapping from
>something to something. I believe the name comes from Perl, although
>they could have taken it from somewhere else. It is really a misnomer,
>as it has nothing to do with "real" arrays.[/color]
Back in the 1960s a lot of people got very excited about associative
memory. It was, at last, possible to build one with less than a roomful
of electronics. As it happens its most common use these days is in
memory caches. These are buried inside processor chips and so are not
very visible to users.
An ordinary array is built from ordinary memory. You put in a relative
address and a value comes back very, very quickly.
An associative array is built from associative memory. You put in a key
and a value comes back also very, very quickly ... if you can afford to
use a million or so transistors. It's a lot slower if you have to use
software to do it.
Altogether, "associativ e array" is a perfectly respectable technical
term that goes back a long way. It's wrong to complain if someone uses
it.
[color=blue]
>In, e.g., Java, I would never say "associativ e array". I'd just say
>"Map".[/color]
In Java, what have Map and Dictionary got in common? They are both
associative arrays. It's not very clear if you have to say that one is a
Map and so is the other. And in C++ you can use array syntax, a[b], to
get at the values.
John
--
John Harris
Comment