[Top][All Lists]

[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: Wed, 5 Aug 2015 05:20:10 -0700 (PDT)
User-agent: G2/1.0

On Wednesday, August 5, 2015 at 3:17:44 PM UTC+5:30, Ted Zlatanov wrote:
> On Wed, 05 Aug 2015 08:12:22 +0200 "Pascal J. Bourguignon"  wrote: 
> PJB> What you are losing from sight is the fact that:
> PJB> - a-lists are lists
> PJB> - p-lists are lists
> PJB> - lists are sequences

And lists (if you were to think mathematically) are sequences
And sequences are maps; in more detail:
A finite sequence over τ 𝒮(τ) is a function  {1..n} → τ
An infinite sequence over τ 𝒮(τ) is a function  ℕ → τ

On the other side, a hash-table is just a map from keys to values
(with algorithmic/storage-layout mixed up as is usually done by low-level

In short a map is the fundamental data structure.

Alternate Existence Proof: Lua has only one data structure -- the table -- which
does the job of both lists and hashes

reply via email to

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