mark li
mark li

Reputation: 347

lua - how to create functions

I have a question about declaring functions in lua.

I was under the impression that public functions are declared as:

abc = function()
end

Local/private functions as:

local abc = function
end

But I'm not sure what this notation is:

function abc()
end

Upvotes: 4

Views: 1139

Answers (1)

Bahbar
Bahbar

Reputation: 18015

As seen in 2.5.9 of the reference manual,

The statement

 function f () body end

translates to

 f = function () body end

Upvotes: 2

Related Questions