Implement foreach in the interpreter