in reply to Re^5: "a bit of sugar "(HOP)
in thread "a bit of sugar "(HOP)

That explains absolutely nothing. You don't need sub Iterator(&) to make sub {...} have the same form as map {...} and grep {...}. It already has that form.

goto 750492;

Replies are listed 'Best First'.
Re^7: "a bit of sugar "(HOP)
by hbm (Hermit) on Mar 13, 2009 at 20:12 UTC
    make sub {...} have the same form as map {...} and grep {...}.

    I didn't say that; I said that prototyping allows Iterator to behave like map { ... } and grep { ... }. And I agree, it also allows Iterator to behave like sub { ... }.

    Meanwhile, curious about the origination of "syntactic sugar", I found this quote:

    Syntactic sugar causes cancer of the semicolon;
    And a hundred other goodies at http://www.cs.yale.edu/quotes.html.

      I didn't say that; I said that prototyping allows Iterator to behave like map { ... } and grep { ... }.

      Then you're assuming Iterator(sub {...}) is the starting point, and that's nonsense.

      sub { ... } is the starting point, and it's already syntactically similar to map { ... } and grep { ... }. To say that (&) is needed to create the iterator while using the BLOCK syntax of map and grep is untrue. (&) is therefore irrelevant to the question at hand.

      Using Iterator is the sugar. It conveys information to the user without any effect on the program. (&) is only the means to make it happen.