ModularM
Modular3y ago
2 replies
gryznar

scope of iteration variable

 fn main():
    var i: Int
    for i in range(3):
        ...


In current state of Mojo, variable i is visible only inside the loop, which means that i outside the loop is another i. Is this only temporary solution or there are greater pros to keep this?
Was this page helpful?