lua-users home
lua-l archive

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


MyProducer is a local variable of the do...end bloc so after you reach the end of this bloc, if you reference MyProducer you get an error for undefined variable. It's not dependent of the type of your variable.

Markus Huber wrote:
   do
      local MyProducer=Producer()  -- returns the coroutine
      repeat
         Error,Data=coroutine.resume(MyProducer)
      until not Data
      print(coroutine.status(MyProducer))  --> suspended!
   end
   print(MyProducer)  --> nil