摘要:
--自己实现迭代器functionget_each_fun(array)locali=0locallength=table.getn(array);returnfunction()i=i+1;return(i>lengthandnil)orarray[i];endendlist={1,3,5,7,9}foriteminget_each_fun(list)doprint(item)endprint'-----------------------------------------------------'foriteminget_each_fun(list)doprint( 阅读全文