Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^7: Can I check if a loop's scope is entered for the first time? (Devel::Callsite)

by Anonymous Monk
on May 07, 2018 at 14:50 UTC ( #1214165=note: print w/replies, xml ) Need Help??


in reply to Re^6: Can I check if a loop's scope is entered for the first time? (Devel::Callsite)
in thread Can I check if a loop's scope is entered for the first time?

Wouldn't it be better to wrap the hard paddle?

sub each_value (&); ... while (my ($a) = each_value {countdown($limit)}) { print $a, ':'; }

  • Comment on Re^7: Can I check if a loop's scope is entered for the first time? (Devel::Callsite)
  • Download Code

Replies are listed 'Best First'.
Re^8: Can I check if a loop's scope is entered for the first time? (Devel::Callsite)
by TheDamian (Priest) on May 08, 2018 at 10:48 UTC

    No question. It would definitely be better.

    Unfortunately, there's no way to give each_value() a prototype
    that allows it to also take a thunky block as an argument...in addition
    to all the other argument types (hash, array, reference) it currently takes.

    The current declaration is:

    sub each_value (+) {...}

    but, to be able to accept a block it would require:

    sub each_value (&) {...}

    and there's no prototype marker than allows both. :-(

    Damian

      and there's no prototype marker than allows both. :-(
      Is it time for customized markers? What would that entail?

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2019-11-18 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (92 votes). Check out past polls.

    Notices?