From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: plists, alists, and hashtables Date: Fri, 7 Aug 2015 09:33:46 -0700 (PDT) Message-ID: References: <876150vwaa.fsf@mbork.pl> <873803x5q4.fsf@kuiper.lan.informatimago.com> <87a8u7we9s.fsf_-_@lifelogs.com> <02f81836-554f-4bb4-873b-85c24e080e3d@googlegroups.com> <87614uqn5l.fsf@kuiper.lan.informatimago.com> <87d1z2ukw1.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1438965321 26652 80.91.229.3 (7 Aug 2015 16:35:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Aug 2015 16:35:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 07 18:35:21 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZNkc3-0005HZ-Pg for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Aug 2015 18:35:19 +0200 Original-Received: from localhost ([::1]:49912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNkc3-0004Kf-0n for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Aug 2015 12:35:19 -0400 X-Received: by 10.107.137.72 with SMTP id l69mr7154042iod.23.1438965227161; Fri, 07 Aug 2015 09:33:47 -0700 (PDT) X-Received: by 10.50.22.67 with SMTP id b3mr83563igf.1.1438965227133; Fri, 07 Aug 2015 09:33:47 -0700 (PDT) Original-Path: usenet.stanford.edu!pg9no7819094igb.0!news-out.google.com!o13ni8823igw.0!nntp.google.com!se8no332035igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.195.35.41; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 117.195.35.41 User-Agent: G2/1.0 Injection-Date: Fri, 07 Aug 2015 16:33:47 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:214036 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106321 Archived-At: 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.=C2=B9 >=20 > 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= =20 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 =E2=86=92 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 u= se If they are just looked-up they are 'data-maps' -- for which a hash-table i= s=20 a typical=C2=B2 data structure IOW functions-as-code and functions-as-data are a primary dual ----------- =C2=B9 No attribution line...Assuming you are quoting me.... =C2=B2 If 90% of all maps/associations are smaller than 10-15, then a linea= r lookup=20 would be clearly a win over more fancy (Pascal's point I think). My point i= s=20 more that the *idea* of a map needs to be fundamental not the details of *i= mplementation*