[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Forum] origin of 'populating a hash'



At 11:29 +0000 08/20/1999, Richard K. Moore wrote:

>Are you suggesting that the term 'hash', or its functionality, originated
>with Perl?  I don't know if any _language before Perl had hashes built in,
>but hashes, by that name, have been in use at least since 1962,
>particularly in compiler work.

No. (I have received private email stressing that my answer could easily be
misinterpreted :(

I am suggesting that the term "hash" when used in this context[1] as a term
meaning what is otherwise called an "associative array", is uniquely
Perlish.

The word hash has been around a long time. The hash table has been around a
long time. Perl hashes _just so happen_ to be implemented as hash tables.
That's the underlying data structure and a good reason for the name. But an
associative array is not itself hash table. That's implementation (in this
case, it's C).

Perl calls these hashes because:
    1) they are disordered
    2) Larry preferred the term "hash" to "associative array"
    3) coincidentally, the internal implementation is a hash table

Coincidence (and probably design, too, but not equivalence).

Read the Camel :-)

Associative arrays are not unique to Perl either. Awk has them. I'm sure
something else does. If awk has them they were invented sometime before
1983.

However, I don't _know of_ another language that uses the term "hash" to
refer to the particular type of "list" which is (in other languages) called
an "associative array".

Thus my statement that
>The hash part is Perl...

>
>'Populate' is particularly appropriate to hashes... elements are referred
>to by name just like people are.

cute. But I sincerely doubt that's why they used the word ... :-)

Although that could be why the database folks chose it...

[1] The English grammar definition of "context" not the Perl definition
-- --
       |\      _,,,---,,_       Vicki Brown <vlb@cfcl.com>
 ZZZzz /,`.-'`'    -.  ;-;;,_   Journeyman Sourceror: Scripts & Philtres
      |,4-  ) )-,_. ,\ (  `'-'  P.O. Box 1269  San Bruno  CA  94066
     '---''(_/--'  `-'\_) http://www.cfcl.com/~vlb  http://www.macperl.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-forum-request@macperl.org