On Tue, Jun 10, 2008 at 02:31:05PM +1000, konrad Zielinski wrote:
> there really isn't a way of implementing a Hash Table in Picolisp is there?


> as far as I understand this would really require an array with direct
> addressing at some point, and we have no such thing. Which would make

Yes, because PicoLisp is deliberately limited to linear lists (besides
numbers and symbols).

There is the possibility of writing a C-function, though, which malloc's
some memory to hold a hash table. The problem with such a solution is
that the garbage collector would not know about this piece of data.

> a tree of some form the best storage option.

As you perhaps know, the easiest way is using a binary tree with the
'idx' function. Or - if the amount of data is large (otherwise you won't
need a hash table) - to build some database structure.

Internally, PicoLisp still uses hashing for the internal, transient and
external symbol tables. But with miniPicoLisp this was changed in favor
of a binary tree, and PicoLisp-3.0 will also use trees exclusively. The
main reason is that trees scale more easily.

> On the other hand I recall readin in the reference that previous
> versions of Pico Lisp used somthing like a hash table for storing
> symbol property lists, so I'm a little confused.

As far as I recall, previous versions used splay trees for symbol
properties (which are just linear assoc-like lists now), but never hash

- Alex

Reply via email to