in reply to Re: RFC: Sub::Attributes -- alter subroutine context behavior with attributes
in thread RFC: Sub::Attributes -- alter subroutine context behavior with attributes

No its not. That marries the code to Ovid's idea of what an iterator's API looks like. If I wrote it I'd have returned a sub reference and called it as $result->() and avoided the whole 'next' thing altogether.
  • Comment on Re: Re: RFC: Sub::Attributes -- alter subroutine context behavior with attributes
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: RFC: Sub::Attributes -- alter subroutine context behavior with attributes
by hardburn (Abbot) on Dec 10, 2003 at 15:53 UTC

    *shrug* Personally, I think it should return a Class::Iterator object (which provides iterator versions of map and grep), though that marries you to Robert Silve's idea of what an iterator API looks like.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    : () { :|:& };:

    Note: All code is untested, unless otherwise stated