[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: "namespaces" ?
- From: "Peter Prade" <prade@...>
- Date: Thu, 18 Apr 2002 20:32:49 +0200
> 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...