Skip to content

Lua: don't create globals #67

@hryx

Description

@hryx

When calling require('libmodipulatelua') it creates a global table called "modipulate" containing the needed functions. This practice is frowned upon by some -- the nicer way to do this is have it return the package. Then you can use it like this:

local modipulate = require('libmodipulatelua')
modipulate.init()
modipulate.loadSong('poop.xm')

Disclosure: I haven't made any C modules for Lua, so I don't know if there any gotchas in making it behave this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions