Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 1 commit comment
  • 1 contributor
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/Mo.pm
View
11 lib/Mo.pm
@@ -3,14 +3,13 @@ require strict; require warnings;
our $VERSION = '0.12';
sub import {
strict->import; warnings->import;
- my $p = caller;
- @{$p.'::ISA'} = $_[0];
- *{$p.'::extends'} = sub { @{(caller).'::ISA'} = $_[0] };
- *{$p.'::has'} = sub {
+ @{$_.'::ISA'} = $_[0],
+ *{$_.'::extends'} = sub { @{(caller).'::ISA'} = $_[0] },
+ *{$_.'::has'} = sub {
my ($n, %a) = @_;
- *{caller."::$n"} =
+ *{(caller)."::$n"} =
sub {@_-1?$_[0]{$n}=$_[1]:$_[0]{$n}//=($a{default}//sub{})->($_[0])}
- };
+ } for scalar caller;
}
sub new {
my $s = bless { @_[1..$#_] }, $_[0]; $s->can('BUILD') && $s->BUILD; $s

Showing you all comments on commits in this comparison.

@sugar84

holy shit

Something went wrong with that request. Please try again.