lua-users home
lua-l archive

Re: Standard libraries (was Re: Virgin tables)

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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

AltStyle によって変換されたページ (->オリジナル) /