lua-users home
lua-l archive

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

As a side note it would be nice if a listing of all of the "special
modifiers" was made and added to the manual (perhaps as a side note in the
metatable section).  The listing could just refer to the relevant section.
The reason for the suggestion is because it would make it easier to find
these options when thinking along the lines of "what can I do with object X"
as opposed to "what can function/system Y do with objects it receives".

If nothing else these items could at least be added to the glossary.

Below are some of the ones that a search of the manual for "__" turned up.
__pow -- global


As a side note, now that I am thinking about this again it would be
interesting to see a compilation of common extensions / best practices for
libraries etc.  For instance, the metatable naming/querying system from the
aux. lib.  Similarly, in transitioning a file saving/loading system I threw
together from Lua4 to Lua5 I replaced a table of specializations per
userdata tag with entries in the metatable of the userdata "types".  Anyway,
I was just curious what other uses for "specialization" methods people have
thought up.

-----Original Message-----
[]On Behalf Of Roberto
Sent: Wednesday, November 19, 2003 5:33 AM
To: Lua list
Subject: Re: Naming userdata objects


> tostring (e)
> [...]
> If the metatable of e has a "__tostring" field, tostring calls the
> corresponding value with e as argument, and uses the result of the call
> as its result.

-- Roberto