This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
xuma202's profile picture

Lua: Decalring a function

Started by xuma202, 08 August 2012 - 04:36 PM
xuma202 #1
Posted 08 August 2012 - 06:36 PM
Hi,

what is the difference between


function a()
  print("test")
end


and


a = function()
  print("test")
end


I've seen both so far and they both work but what is the difference?
Cloudy #2
Posted 08 August 2012 - 06:45 PM
Nothing really - function a() is just syntactic sugars for a = function().