Created
January 14, 2012 08:01
-
-
Save dvv/1610685 to your computer and use it in GitHub Desktop.
MoonScript + CoffeeScript syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is, isnt | |
==== | |
is, isnt ---> ==, ~= | |
else if | |
==== | |
if 1 | |
p(1) | |
else if 2 | |
p(2) | |
if 1 then | |
p(1) | |
elseif 2 then | |
p(2) | |
end | |
for of | |
==== | |
for k, v of o | |
stat | |
end | |
for k, v in pairs(o) do | |
stat | |
end | |
for own of | |
==== | |
for own k, v of o | |
stat | |
end | |
for k, v in pairs(o) do if rawget(o, k) ~= nil then | |
stat | |
end end | |
for in | |
==== | |
for i in {1, 2, 3} | |
f(i) | |
for _, i in ipairs({1,2,3}) do | |
f(i) | |
end | |
allow [] for array-like tables | |
==== | |
foo = [1,2,3] | |
local foo = {1,2,3} | |
continue | |
==== | |
mimick via new goto | |
allow # as comment sign | |
==== | |
# comment here | |
#comment here | |
-- comment here | |
#comment(here) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment