function square(state,control) if(control>=state) then return nil else control=control+1 return control,control*control end end
for k,v in square,9,0 do print(k,v) end
收起
泛型for本来就是这么写的啊。pairs()那么写是因为它能返回需要的3个值。
报告相同问题?