I got an error if I like it. What should I do?
local function one() local function two() local function three() callMe() -- got error here end end end local function callMe() print ("can't call :(") end callMe()
locals must be declared before using:
local callMe local function one() local function two() local function three() callMe() -- got error here end end end function callMe() print ("can't call :(") end callMe()
As well as the lack of () for one , two and three , as Bart Kirs said, calling three() will be an error, since callMe is a local function outside the scope of three , so it does not know this function.
()
one
two
three
three()
callMe
Source: https://habr.com/ru/post/1432605/More articles:will_paginate shows the last page by default (keeping chronological order) - ruby | fooobar.comIntellisense and strongly typed data controls - no more typos ...? - asp.netLua: How to call a function before defining it? - luaJruby rb for java generated class inheritance support or workarounds - jrubyWindsor Castle FirstInterface (). Configure (c => c.LifeStyle.PerWebRequest) - c #Render Bootstrap modal from partial to rails - ruby-on-railsHow do you use git to sync an iOS project between multiple computers - gitcreating an instance of a class type variable - javaiOS: adMob for universal app? - iosHow to convert DEC to HEX in javascript? - javascriptAll Articles