Radiance icon indicating copy to clipboard operation
Radiance copied to clipboard

Feature: Range literal expression

Open shortercode opened this issue 5 years ago • 0 comments

Description

Looping a set number of times with a while loop is slightly cumbersome, requiring an additional variable declaration and a increment/decrement expression. A much better alternative would be to use for...of with some form of Iterable value. The addition of a range literal that implements the Iterable interface would fulfil the requirements.

for i of 0...10 {
  print(i)
}

shortercode avatar Aug 28 '20 15:08 shortercode