lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> It would encourage a more top-down approach to programming
> if definitions could appear later in the source code
> after an identifier has been used.

A definition can appear later than an identifier, as long as you do
not actually call the identifier. So, if you are writing a list of
functions, they can call each other regardless their order (because a
function definition does not run the function).

  function main ()  return foo1() end
  function foo1 ()  return foo2() end
  function foo2 ()  return foo3() end
  function foo3 ()  return foo4() end
  [...]
  main ()   -- << start program

-- Roberto