[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Standard libraries (was Re: Virgin tables)
- From: Dirk Laurie <dpl@...>
- Date: Mon, 3 Jan 2011 13:01:50 +0200
On Mon, Jan 03, 2011 at 02:40:06AM +0200, Quae Quack wrote:
> So... in lack of this magical site for working on common code, I
> submit for consideration a suitable array implementation:
Your code forces all indices to be numbers. That is not necessary.
It should force all integer keys to lie in a block 1 to #a with
no holes, yes, but string keys are OK. They don't confuse the table
library functions and are quite useful.
E.g. this line from a data file of finite integer sequences:
entry{3,5,17,257,65537, note="all known Fermat primes", OEIS="A000215",
formula=function (n) return 2^(2^(n-1))+1 end}
Dirk