On Sun, Jul 31, 2016 at 1:48 AM, Steven D'Aprano <st...@pearwood.info> wrote: > Hypertalk (and related XTalk languages) offer a number of dedicated looping > constructs. Using square brackets [] for optional terms: > > repeat [forever] > repeat [for] number [times] > repeat until condition > repeat while condition > repeat with variable = start [to] end > repeat with variable = start [down to] end > > > That's right, a bare "repeat" on its own gives you an infinite loop. Does > *your* language have special syntax for infinite loops? If not, why not?
Hmm, very similar to REXX, with one critical difference. Here's REXX's loops: do do forever do number do while condition do until condition do variable = start [to end] [by step] [for count] In REXX, "do forever" is like Hypertalk's "repeat forever", and the other constructs are similar (though the counted form is more flexible - you can say "do i=1 to 10" to set the end marker, or you can say "do i=1 for 10" to set an iteration count) - but "do" on its own means "execute this block of code exactly once", not an infinite loop. (do/end in this form is for defining blocks of code, like Pascal's begin/end or C's { }.) Curious distinction. ChrisA -- https://mail.python.org/mailman/listinfo/python-list