Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

P6: how to <strike>supercede</strike> supersede

by rir (Vicar)
on Jun 14, 2010 at 18:52 UTC ( #844704=perlquestion: print w/ replies, xml ) Need Help??
rir has asked for the wisdom of the Perl Monks concerning the following question:

update: corrected misspelling of supersede to avoid propagating the error.

I can't find the syntax to make supercede supersede work.

sub asub ( $ace, $deuce?, $trey? ) { say "$ace $deuce $trey"; } use Test; supersede sub asub( $ace, $deuce?, $trey? ) { # XXX die "asub"; } my $derr; try { asub( 1, 2, 3); CATCH { $derr = $!; } } ok( $derr eq "asub", "asub died" );
Be well,
rir

Comment on P6: how to <strike>supercede</strike> supersede
Select or Download Code
Re: P6: how to supersede
by moritz (Cardinal) on Jun 14, 2010 at 19:29 UTC
    It helps if you spell it right :-)
    $ ./perl6 -e 'supersede sub a { }' ===SORRY!=== "supersede" not yet implemented at line 1, near " sub a { }"

    ... for some value of "helps".

    What works today is hiding outer sub in an inner lexical scope:

    sub asub ( $ace, $deuce?, $trey? ) { say "$ace $deuce $trey"; } use Test; plan 1; { sub asub( $ace, $deuce?, $trey? ) { 'asub' }; is asub(1), 'asub', 'lexically hiding works'; }
    Perl 6 - links to (nearly) everything that is Perl 6.
      If you secede on spelling "supersede", you cede success and seed duress, successively and successfully.
      It helps if you spell it right :-)

      Well, um, um, ah, yes. Good point, thanks and for the work around.

      It is nice to see improved error messages in the pipe.

      Be well,
      rir

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://844704]
Approved by ikegami
Front-paged by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2015-07-04 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls