Skip to content

Instantly share code, notes, and snippets.

@kidapu
Last active February 9, 2016 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidapu/19b475c65f0c9c6a1e9c to your computer and use it in GitHub Desktop.
Save kidapu/19b475c65f0c9c6a1e9c to your computer and use it in GitHub Desktop.
the way to require class in moonscript. http://www.luafaq.org/#T8.1.5
test = require "test"
t = test.TestClass()
t\update()
t\print()
print t.val
G = {}
class TestClass
new: =>
@aa = 0
@val = 100
update: =>
@aa += 1
@aa
print: =>
print @aa
G.TestClass = TestClass
return G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment