Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by spacebat (7584) on 2008.01.14 1:52 (#60214) Homepage
    What I'd like to see is something like Python's generators. While one could argue we've got something similar by using closures, its not the same thing. Generators can return values with a yield statement, resume execution on the next line when they are called again, which can make the control flow in the generator much clearer.

    For me the real benefit of generators is that they are very fast, in the interpreter instead of 100+ lines of C to enter a function, once a generator is called initially its just a handful of lines to pass control back into it. This makes iteration fast and provides a way to sidestep the overhead of function calls that seems unavoidable in Perl.

    If I'm off base on this or Perl5/6 already has something like it, I'm most interested to know.

    Cheers!
    --
    Every token is like an unnecessary stain on whitespace and idleness.