lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
I have a proposal for a new operator (after all these years): "*t" would
return the "size" of table t.

Ohh, sorry to piggyback a semi-related request on that post,
but I like that idea and wanted to make an additional suggestion:
please consider making the action of '*t' overridable with a
metamethod.  While this might conceivably permit custom getn-like
behaviour, I mainly think that a unary-* would be a fairly
intuitive syntax for some other things (particularly a copy-by-
value for an object).

Regards,
--Adam