mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-10-17 22:52:14 +00:00
syntax: 'var'->'let' 'function'->'func'
- 'var' has some weird scoping connotations with users of JS. better to change it to 'let', which will decide whether to make the variable a local or a global - 'func' looks visually appealing lol - some minor refactoring done in cparse.c
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local function fib(num)
|
||||
local func fib(num)
|
||||
if num <= 1 then
|
||||
return num
|
||||
else
|
||||
@@ -6,6 +6,6 @@ local function fib(num)
|
||||
end
|
||||
end
|
||||
|
||||
for (var i = 1; i < 40; i++) do
|
||||
for (let i = 1; i < 40; i++) do
|
||||
print("The fib number of " .. i .. " is " .. fib(i))
|
||||
end
|
Reference in New Issue
Block a user