Mercurial > pub > Impl
changeset 178:658a80d19d33
new constructor syntax
author | sourcer |
---|---|
date | Wed, 12 Oct 2011 00:06:07 +0300 |
parents | df71a307ef9b |
children | b3d91ff7aea9 |
files | Lib/IMPL/lang.pm |
diffstat | 1 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/Lib/IMPL/lang.pm Wed Oct 12 00:04:13 2011 +0300 +++ b/Lib/IMPL/lang.pm Wed Oct 12 00:06:07 2011 +0300 @@ -39,7 +39,6 @@ &static &property &ctor - &base ) ], compare => [ @@ -120,7 +119,7 @@ } sub ctor(&;$) { - my ( $code, $base ) = @_; + my ( $code, %base ) = @_; no strict 'refs'; my $class = caller; @@ -128,15 +127,11 @@ *{"${class}::CTOR"} = $code; } - if (ref $base eq 'HASH') { - %{"${class}::CTOR"} = %$base; + if (%base) { + %{"${class}::CTOR"} = %base; } } -sub base($) { - return shift; -} - sub equals { if (defined $_[0]) { return 0 if (not defined $_[1]);