You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ponymail.apache.org by sebbASF <gi...@git.apache.org> on 2016/12/13 14:59:08 UTC

[GitHub] incubator-ponymail issue #294: Bug: lua modules should define local function...

GitHub user sebbASF opened an issue:

    https://github.com/apache/incubator-ponymail/issues/294

    Bug: lua modules should define local functions only

    Lua modules should not create or use global variables to avoid polluting the caller's namespace.
    
    The same applies to functions.
    
    These should all be defined as local, then the only way to invoke them is through the table returned by the require statement.
    
    For example, at present lib/aaa.lua defines the function getRights and returns the hash 
    { rights = getRights }
    
    So the result of 
    
    local aaa = require 'lib/aaa'
    
    is the function callable as aaa.rights()
    
    However the same function also callable as getRights().

----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ponymail issue #294: Bug: lua modules should define local function...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the issue at:

    https://github.com/apache/incubator-ponymail/issues/294


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---