lua-users home
lua-l archive

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


> often anyway.  I.e. you want to write t:append(e) instead
> of Table.append(t,a) or x:sin() instead of Number.sin(x).

hmm, what makes x:sin() preferable over sin(x) ?
the whole idea of putting global functions into modules is to not pollute
the global namespace.
but when you register a tagmethod for a type like "number", isn't that
against the spirit of not polluting namespaces?
You don't pollute the "global variable name" space, agreed. but instead you
pollute the "tagmethods for numbers" space.

I think in this case it might be easier to stick with sin(x) - i think
x:sin() looks somehow ridiculous...

--Peter [http://lua-users.org/wiki/PeterPrade]