[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Conceptual problem with gettable tag method
- From: Edgar Toernig <froese@...>
- Date: Thu, 08 Jun 2000 04:57:57 +0200
Bruno Silva wrote:
> This approach works fine, but there is one piece missing: if the vectors are
> lua tables, you can actually enumerate the fields in lua (with foreach(),
> for example). So you can print a vector with foreach(v,print). Since there
> are currently no tag methods for enumerating elements, you can't really make
> the behavior of usertags indistinguishable from that of true lua tables for
You "could" make it work by overloading foreach... Not that I would
advocate that *g*. But is that a requiredment to behave exactly like
tables? He may want to add arithmetic tag methods and then they are
really different. Using the get/settable method is just a way to get
a nice syntax to access fields.
A "next" and "tostring" method would be really nice though.