in reply to Re^6: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20
in thread use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20

then somebody calling that function is now able to pass it, instead of a hashref, a blessed object providing the same interface; i.e. polymorphism.

This is an interesting argument. Particularly this bit:

it's not easy to, say, quickly override the order a foreach loop will traverse an array.

Any chance of you knocking up an example for this?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^7: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20

Replies are listed 'Best First'.
Re^8: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20
by chromatic (Archbishop) on Nov 25, 2013 at 20:05 UTC

    Maybe not changing the traversal order, but it'd be nice to have some sort of iteration interface so that we could use for against a collection or generator or iterator or array without having to flatten the values into a list.

      it'd be nice to have some sort of iteration interface so that we could use for against a collection or generator or iterator or array without having to flatten the values into a list.

      Um, neither for my $item ( @array ) { ... } nor ... for @array; flatten?

      And for hashes, use ... while (key, value) = each %hash;


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Sure, Perl has special ops for non-flattening iteration of arrays and hashes, but it doesn't have an iteration interface so you can't write your own non-flattening iterator.