diff Lib/IMPL/Object/List.pm @ 3:2e546a5175dd

in developing
author Sergey
date Tue, 11 Aug 2009 17:45:52 +0400
parents 78cd38551534
children e59f44f75f20
line wrap: on
line diff
--- a/Lib/IMPL/Object/List.pm	Mon Aug 10 17:39:08 2009 +0400
+++ b/Lib/IMPL/Object/List.pm	Tue Aug 11 17:45:52 2009 +0400
@@ -3,11 +3,21 @@
 use warnings;
 
 use base qw(IMPL::Object::ArrayObject);
+use IMPL::Exception;
 
 sub as_list {
     return $_[0];
 }
 
+sub CTOR {
+    my ($this,$data) = @_;
+    
+    if ($data) {
+        die new IMPL::InvalidArgumentException("The parameter should be a reference to an array") unless UNIVERSAL::isa($data,"ARRAY");
+        @$this = @$data;
+    }
+}
+
 sub Append {
     push @{$_[0]}, @_{1 .. @$_-1};
 }