简体   繁体   中英

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

As seen in 2.5.9 of the reference manual ,

The statement

 function f () body end

translates to

 f = function () body end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM