-
-
Save rjbs/bb1c0486efc19b54f12b69ae368233cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v5.20.0; | |
| package CliM8::LoopControl::Continue { | |
| use Moo; | |
| sub throw { die $_[0]; } | |
| no Moo; | |
| } | |
| package CliM8::LoopControl::Pop { | |
| use Moo; | |
| extends 'CliM8::LoopControl::Continue'; | |
| no Moo; | |
| } | |
| package CliM8::LoopControl::Push { | |
| use Moo; | |
| extends 'CliM8::LoopControl::Continue'; | |
| has activity => (is => 'ro', required => 1); | |
| no Moo; | |
| } | |
| package CliM8::LoopControl::Swap { | |
| use Moo; | |
| extends 'CliM8::LoopControl::Pop', 'CliM8::LoopControl::Push'; | |
| no Moo; | |
| } | |
| my $push = CliM8::LoopControl::Push->new({ activity => 1 }); | |
| my $swap = CliM8::LoopControl::Swap->new({ activity => 1 }); | |
| # To my surprise, $swap->{activity} is not present. | |
| use Data::Dumper; | |
| warn Dumper($push); | |
| warn Dumper($swap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.