[Bps-public-commit] r13857 - in Lorzy/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Tue Jul 8 11:18:05 EDT 2008


Author: sartak
Date: Tue Jul  8 11:18:05 2008
New Revision: 13857

Modified:
   Lorzy/trunk/   (props changed)
   Lorzy/trunk/lib/Lorzy/Block.pm

Log:
 r63827 at onn:  sartak | 2008-07-08 11:18:00 -0400
 Block: Don't need to explicitly default to undef, use BUILD instead of around new


Modified: Lorzy/trunk/lib/Lorzy/Block.pm
==============================================================================
--- Lorzy/trunk/lib/Lorzy/Block.pm	(original)
+++ Lorzy/trunk/lib/Lorzy/Block.pm	Tue Jul  8 11:18:05 2008
@@ -4,28 +4,28 @@
 our $BLOCK_IDS = 0;
 
 has block_id => (
-                 is => 'ro',
-                 isa => 'Num',
-                 default => sub { ++$BLOCK_IDS },
+    is      => 'ro',
+    isa     => 'Num',
+    default => sub { ++$BLOCK_IDS },
 );
 
 has outer_block => (
-                     is => 'rw',
-                     weak_ref => 1,
-                     default => sub { undef },
+    is       => 'rw',
+    weak_ref => 1,
 );
 
-around 'new' => sub {
-    my $next = shift;
-    my $class = shift;
-    my $self = $class->$next(@_);
+sub BUILD {
+    my $self = shift;
     return $self if ref($self) eq 'Lorzy::Lambda::Native';
-    $self->_walk( $self,
-                  sub { my $block = shift;
-                        return unless $block->does('Lorzy::Block');
-                        $block->outer_block($self);
-                        return 1;
-                    } );
+    $self->_walk(
+        $self,
+        sub {
+            my $block = shift;
+            return unless $block->does('Lorzy::Block');
+            $block->outer_block($self);
+            return 1;
+        },
+    );
 
     return $self;
 };
@@ -47,8 +47,7 @@
             $self->_walk($exp->args->{$_}, $cb);
         }
     }
-
 }
 
-
 1;
+



More information about the Bps-public-commit mailing list