[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: upgrading to 4.0(a)
- From: Edgar Toernig <froese@...>
- Date: Thu, 31 Aug 2000 03:52:07 +0200
Luiz Henrique de Figueiredo wrote:
> >From: Stephan Herrmann <firstname.lastname@example.org>
> >I'm the only one who needs this predictable ordering?
> Surely not. But I don't see a way out.
> Perhaps you can give more examples of why this would be useful and how this
> could be implemented...
Ordered tables would be nice. In MUMPS for example (terrible language but
cute arrays) all arrays are ordered. And, arrays could be in-core or on-
disk. They build complete databases with these (variable length key/data)
They used b*trees for the on-disk arrays. Don't know about the in-core
ones, I would guess either standard binary trees or even b*trees too to
get a simple memory management.
Putting ordered tables into Lua would cost a lot. Good bye performance.
But, you could implement them as userdata. There's just one pitfall:
You have to create references to the elements. And that's memory
consuming and slow. But if Lua were able to walk these userdata-tables
during the gc-phase (ie gc-mark tagmethod) ... *hinthint*g*