[?] Make an Infinite loop with Do function?

Hi all,

I need to make an infinite loop with Do function

Anyone can help me?

Thank you

I need to make an infinite loop with Do function

The latest version 11.2.0 allows this:

Dynamic[i]
Do[i, {i, Infinity}]

But for what purpose do you need it?

I imagine verifying it will actually iterate to Infinity would have presented some testing challenges :slight_smile:

The Infinity spec should work:

Do[expr, Infinity]

See Do: Run an iterative loop—Wolfram Documentation,

Do[expr,Infinity] continues evaluating expr until explicitly told to
exit through a function such as Break, Return, Throw, Abort, or Quit.

Another simple thing While[True, ... ] construct:

n = 1; While[True, Pause[1]; Print[n]; n++]