#153·Cello

foreach with duplicate tuple objects causes infinite loop

Author: awmorganCreated Dec 1, 2024Updated Dec 1, 2024

This code will cause an infinite loop and the program will print item 1 over and over and never print item 2.

  var i = $I(1);
  var t1 = tuple(i, i, $I(2));
  foreach (item in t1) {
    println("item: %$", item);
  }