help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: plists, alists, and hashtables


From: Rusi
Subject: Re: plists, alists, and hashtables
Date: Fri, 7 Aug 2015 09:33:46 -0700 (PDT)
User-agent: G2/1.0

On Friday, August 7, 2015 at 12:50:20 AM UTC+5:30, Stefan Monnier wrote:
> > In short a map is the fundamental data structure.¹
> 
> Beware: there are maps and then there are maps.
> E.g. Javascript's objects are maps (typically thought of as being
> implemented as some kind of hash-tables), yet Javascript also comes with
> hash-tables.

Thats the whole point
Python: Zen on python makes a big todo about namespaces because they work 
uniformly and nicely for objects, classes, modules... All of which are
dictionaries ie maps
Lua: Only one collection data structure -- the table.
Tables made without explicit keys just use 1,2,3 etc ie normal lists with
the expected convenient lists syntax. Brings me to...
SQL: All of sql hangs around relations. May be called 'relation' but they
are invariably key → tuple maps

Finally a more 'fundamentalist' viewpoint:

Programmers write functions as their most primary activity
If they are algorithmic they are the functions that all programmers daily use
If they are just looked-up they are 'data-maps' -- for which a hash-table is 
a typical² data structure

IOW functions-as-code and functions-as-data are a primary dual
-----------
¹ No attribution line...Assuming you are quoting me....
² If 90% of all maps/associations are smaller than 10-15, then a linear lookup 
would be clearly a win over more fancy (Pascal's point I think). My point is 
more that the *idea* of a map needs to be fundamental not the details of 
*implementation*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]