Hi Enrique,

thanks for your ideas and elaborations!

Personally, I must say that I am against using arrays in PicoLisp, and
wrote it up a few years ago in:


Can you give me an example where you need a list with 65536 elements, in
a Lisp program? Normally you would use some kind of tree to maintain
larger data structures, and you example of using helper list does
exactly that.

Besides this, technically your implementation looks good.

It breaks the Lisp programming style though. You can't use the rich set
of list-manipulation functions on arrays. To do anything interesting,
you have to either fetch the whole array (or parts of it) into a list,
or operate one by one by accessing individual elements. Very tedious.

You have to take care of garbage collecting these arrays by yourself,
i.e. to know when a given array is no longer needed. and this
inconvenience alone destroys the possible advantage of an array.

In addition:

> 2) I suppose that the garbage collector would have to keep track of
> all those CELL pointers in the array, that are outside of the reach of

Correct. Without that, you can store only short numbers (up to 60 bits)
in such an array. Data of any other type (bignums, symbols or lists)
will be thrown away by the garbage collector and your program will crash
horribly ;)

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to