Search found 5 matches

by tobiassjosten
Tue Jan 26, 2010 2:23 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: The Shared Namespace and You
Replies: 34
Views: 45998

Re: The Shared Namespace and You

1. You fail to explain *why* we'd need modules. You should have modules because this would make it easier to distribute isolated functionality. 2. You fail to discuss your module idea in the context of client objects (triggers, aliases, buttons, keys etc.) as they are the most important part of any...
by tobiassjosten
Tue Jan 26, 2010 10:43 am
Forum: Howtos, FAQs and Tips & Tricks
Topic: The Shared Namespace and You
Replies: 34
Views: 45998

Re: The Shared Namespace and You

Why do we need to have modules? You should have modules because this would make it easier to distribute isolated functionality. A queue system, map handling, notification system, anti-illusion helpers, etc. Handy things like the Lua serializer that Nick Gammon wrote and ships with MUSHclient is ano...
by tobiassjosten
Thu Jan 21, 2010 9:49 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: The Shared Namespace and You
Replies: 34
Views: 45998

Re: The Shared Namespace and You

Read the documentation for the module function. This function creates a table and uses setfenv to set this table as the environment for the file currently run. So everything you define in this file goes into the new table. However, this causes problems when you want to access the global namespace f...
by tobiassjosten
Sat Jan 16, 2010 10:32 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: The Shared Namespace and You
Replies: 34
Views: 45998

Re: The Shared Namespace and You

Because that's laggy. This isn't. I would love to see your sources. Yeah, that's a challenge. Sorry, but I can't see how modules and closures are related to the topic of this thread. Lua has a shared namespace and Lua "modules" are still sharing the same namespace as the rest of the scrip...
by tobiassjosten
Thu Jan 14, 2010 5:12 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: The Shared Namespace and You
Replies: 34
Views: 45998

Re: The Shared Namespace and You

Lua have modules and closures to solve this very problem. Why would you want to promote this anti-pattern over those features?