Skip to content

Commit

Permalink
Released version 0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Sep 11, 2011
1 parent c30cf5c commit ba330b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Changes
@@ -1,4 +1,9 @@
---
version: 0.18
date: Sun Sep 11 09:52:30 CEST 2011
changes:
- Don't pollute namspace with _ (or anything)
---
version: 0.17
date: Sun Sep 11 03:24:17 CEST 2011
changes:
Expand Down
8 changes: 4 additions & 4 deletions lib/Mo.pm
@@ -1,4 +1,4 @@
package Mo; require strict; require warnings; $Mo::VERSION = '0.17';
package Mo; require strict; require warnings; $Mo::VERSION = '0.18';
sub import {strict->import;warnings->import;my $p=caller;@{$p.'::ISA'}=$_[0];
*{$p.'::extends'} = sub {@{(caller).'::ISA'}=@_;eval "require $_" for @_};
*{$p.'::has'} = sub { my ($n, %a) = @_; my($d,$b)=@a{qw(default builder)};
Expand All @@ -7,7 +7,7 @@ sub import {strict->import;warnings->import;my $p=caller;@{$p.'::ISA'}=$_[0];
$b ? sub { $#_ ? ($_[0]{$n} = $_[1]) : (exists $_[0]{$n})
? $_[0]{$n} : ($_[0]{$n} = $_[0]->$b) }
: sub { $#_ ? $_[0]{$n} = $_[1] : $_[0]{$n} } }; }
sub _ { my ($a, $c) = @_; for my $p (@{$c."::ISA"}) { next if $p eq 'Mo';
unshift @$a, $p; _($a, $p); } @$a; }
my $i;$i = sub {my ($a, $c) = @_;for my $p (@{$c."::ISA"}) { next if $p eq 'Mo';
unshift @$a, $p; $i->($a, $p); } @$a; };
sub new { my $c=shift; my$s=bless{@_},$c;
do{&{$_."::BUILD"}($s) if defined&{$_."::BUILD"}} for (_([$c],$c)); $s }
do{&{$_."::BUILD"}($s) if defined&{$_."::BUILD"}} for ($i->([$c],$c)); $s }

0 comments on commit ba330b3

Please sign in to comment.