forked from ingydotnet/mo-pm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
where applicable the Mo package also comes with double-colons
- Loading branch information
1 parent
81b1988
commit 13d8d8c
Showing
4 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package Mo; | ||
$VERSION=0.24; | ||
no warnings;my$K=__PACKAGE__;*{$K.'::Object::new'}=sub{my$c=shift;my$s=bless{@_},$c;my@B;do{@B=($c.'::BUILD',@B)}while($c)=@{$c.'::ISA'};exists&$_&&&$_($s)for@B;$s};*{$K.'::import'}=sub{import warnings;$^H|=1538;my$P=caller."::";my%e=(extends=>sub{eval"no $_[0]()";@{$P.'ISA'}=$_[0]},has=>sub{my$n=shift;*{$P.$n}=sub{$#_?$_[0]{$n}=$_[1]:$_[0]{$n}}},);for(@_[1..$#_]){eval"require Mo::$_;1";%e=&{$K."::${_}::e"}($P=>%e)}*{$P.$_}=$e{$_}for keys%e;@{$P.'ISA'}=$K.'::Object'}; | ||
no warnings;my$K=__PACKAGE__."::";*{$K.'Object::new'}=sub{my$c=shift;my$s=bless{@_},$c;my@B;do{@B=($c.'::BUILD',@B)}while($c)=@{$c.'::ISA'};exists&$_&&&$_($s)for@B;$s};*{$K.'import'}=sub{import warnings;$^H|=1538;my$P=caller."::";my%e=(extends=>sub{eval"no $_[0]()";@{$P.'ISA'}=$_[0]},has=>sub{my$n=shift;*{$P.$n}=sub{$#_?$_[0]{$n}=$_[1]:$_[0]{$n}}},);for(@_[1..$#_]){eval"require Mo::$_;1";%e=&{$K."${_}::e"}($P=>%e)}*{$P.$_}=$e{$_}for keys%e;@{$P.'ISA'}=$K.'Object'}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package Mo::has;;package Mo;$K=__PACKAGE__;use Mo::default;use Mo::builder; | ||
package Mo::has;;package Mo;$K=__PACKAGE__."::";use Mo::default;use Mo::builder; | ||
$VERSION=0.24; | ||
*{$K.'::has::e'}=sub{my$P=shift;&{$K.'::builder::e'}($P,&{$K.'::default::e'}($P,@_))}; | ||
*{$K.'has::e'}=sub{my$P=shift;&{$K.'builder::e'}($P,&{$K.'default::e'}($P,@_))}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package Mo::has;;package Mo;$MoPKG = __PACKAGE__; | ||
package Mo::has;;package Mo;$MoPKG = __PACKAGE__."::"; | ||
use Mo::default; | ||
use Mo::builder; | ||
$VERSION = 0.24; | ||
|
||
*{$MoPKG.'::has::e'} = sub { | ||
*{$MoPKG.'has::e'} = sub { | ||
my $caller_pkg = shift; | ||
&{$MoPKG.'::builder::e'}($caller_pkg, | ||
&{$MoPKG.'::default::e'}($caller_pkg, @_)); | ||
&{$MoPKG.'builder::e'}($caller_pkg, | ||
&{$MoPKG.'default::e'}($caller_pkg, @_)); | ||
}; |