Mercurial > pub > Impl
diff Lib/IMPL/Object/List.pm @ 4:e59f44f75f20
DOM - в разработке
Testing - по мелочи
Property - изменен механизм выбора имплементора
author | Sergey |
---|---|
date | Wed, 12 Aug 2009 17:36:07 +0400 |
parents | 2e546a5175dd |
children | 75980091813b |
line wrap: on
line diff
--- a/Lib/IMPL/Object/List.pm Tue Aug 11 17:45:52 2009 +0400 +++ b/Lib/IMPL/Object/List.pm Wed Aug 12 17:36:07 2009 +0400 @@ -6,7 +6,7 @@ use IMPL::Exception; sub as_list { - return $_[0]; + return wantarray ? @{$_[0]} : $_[0]; } sub CTOR { @@ -52,4 +52,21 @@ return splice @$this,$index,$count; } +sub RemoveItem { + my ($this,$item) = @_; + + @$this = grep $_ != $item, @$this; + + return $this; +} + +sub RemoveItemStr { + my ($this,$item) = @_; + + @$this = grep $_ ne $item, @$this; + + return $this; +} + + 1;