> On 11 June 2012 20:00, David Kastrup <dak@gnu....> wrote:
>>> I guess to summarize: if you want an abstraction like tables, you would
>>> build it out of vectors and hash tables. But vectors and hash tables
>>> themselves are the lower-level building blocks.
>> Not low-level enough: they are already specialized in different
>> directions making them equally unsuitable for footing the bill.
> The Implementation of Lua 5.0 , section 4 illustrates how Lua
> tables are constructed from a standard hash table and array (vector).
> In particular, see Figure 2.
> The contiguous, numerically indexed slots are stored only in the
> array, with all other slots stored only in the hash table. This is
> perfectly able to be implemented in guile using the standard vectors
> and hash tables. It does require the vectors to be growable,
Cough, cough. Standard vectors are not growable. Which is the original
problem of this thread, never mind Lua.
> a that capability which has already been demonstrated.
> As Andy points out, Scheme (and guile) provide a toolset of primitive
> data types out of which you can build the particular abstractions you
Too bad that the existing types all have rather arbitrary seeming
limitations. Vectors don't grow, hashtables have additional indirection
through hash buckets and coalescing lists, vlists are immutable.
It seems like they are all rather similar, and all with a rather
arbitrarily chosen additional restriction tacked on making them
unsuitable for this task.
> When comparing Lua to guile I would not consider it an issue that
> guile does not natively provide a particular data type because most
> data types are simple to implement with the tools provided.