Are you looking for the outer keyword?
function foo(p)
   local i
   for outer i = 1:100
       rand() > p && break
   end
   return i
end
Are you looking for the outer keyword?
function foo(p)
   local i
   for outer i = 1:100
       rand() > p && break
   end
   return i
end