Despite some indications to the contrary this week, the Mozilla Foundation did not release its next version of the Firefox browser, which is still being widely, publicly tested under Release Candidate 2. As Mozilla's vice president for engineering, Mike Schroepfer, told BetaNews on Friday, Firefox releases take place on a qualitative basis, not on a deadline or time scale. The organization will release the next production version of the browser when it feels it's ready for prime time.
"I think what we focused on in [upgrading] the core platform," Schroepfer said, "was, how do we put the right core primitives in the main platform to make Firefox both a great development platform and a great platform for end users to use, and then how do we leverage the extensibility of that platform through extensions to let developers effectively write their own tools that they need to write, in order to build these vast, distributed Web-based applications?"
With generators and iterators instead, a variable can be declared and assigned the function containing the reiterative loop as its "value." Here, the variable acts more like an object. The loop clause that counts the first numbers in the sequence exists outside the function, so the main body of the program has control over how many times the function is entered.
Execution steps into the function for one round -- one iteration -- by means of the .next method, which acts as the iterator. The function "knows" it's being used for multiple iterations, even though it doesn't maintain the loop. It gracefully passes execution back to the main body, which has the loop, by means of the all-new yield statement. This is the generator.
BetaNews will feature more with Mike Schroepfer and more of the new under-the-hood features of Firefox 2.0 as its release approaches.