buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.16k stars 32 forks source link

foreach should loop over copy of iterable #112

Closed giann closed 9 months ago

giann commented 1 year ago

foreach should operate on a copy of the iterable so that the body of the loop can add/remove element from the iterable.

Ideally it should only do this if the loop body mutates the iterable.