feature wish

  1. A

    Iterate over multiple collections with single foreach

    A convenience thing; it would be nice to write: // Assume factors = int[] {1..12} foreach (int m in factors, int n in factors) // iterate over multiple collections Debug.Log(string.Format("{0} x {1} = {2}", m, n, m * n)); Instead of: foreach (int m in factors) foreach (int n in factors)...
  2. A

    Ordinal numbers in foreach loops (not a question)

    It would be nice to (optionally) have access to ordinal numbers in foreach loops. For example, printing an enumerated list of names: foreach (string name in names ord as n) Debug.Log(string.Format("{0}. {1}", n + 1, name)); The keyword 'ord' starts at 0 and increments by 1 per iteration. It...
Back
Top Bottom