comparison lib/IMPL/lang.pm @ 419:bbc4739c4d48 ref20150831

working on IMPL::Config::Container
author cin
date Sun, 29 Jan 2017 10:30:20 +0300
parents 30e8c6a74937
children 7798345304bc
comparison
equal deleted inserted replaced
418:3f38dabaf5cc 419:bbc4739c4d48
1 package IMPL::lang; 1 package IMPL::lang;
2 use strict; 2 use strict;
3 use warnings; 3 use warnings;
4 4
5 use parent qw(Exporter); 5 use parent qw(Exporter);
6 use IMPL::_core::version;
7 use IMPL::clone qw(clone); 6 use IMPL::clone qw(clone);
8 use Scalar::Util qw(blessed); 7 use Scalar::Util qw(blessed);
9 use POSIX; 8 use POSIX;
10 use Carp qw(carp); 9 use Carp qw(carp);
11 10
17 &clone 16 &clone
18 &isclass 17 &isclass
19 &typeof 18 &typeof
20 &ishash 19 &ishash
21 &isarray 20 &isarray
21 &isscalar
22 &isglob
22 ) 23 )
23 ], 24 ],
24 25
25 declare => [ 26 declare => [
26 qw( 27 qw(
88 89
89 sub ishash { 90 sub ishash {
90 not blessed($_[0]) and ref $_[0] eq 'HASH'; 91 not blessed($_[0]) and ref $_[0] eq 'HASH';
91 } 92 }
92 93
94 sub isscalar {
95 not blessed($_[0]) and ref $_[0] eq 'SCALAR';
96 }
97
98 sub isglob {
99 not blessed($_[0]) and ref $_[0] eq 'GLOB';
100 }
101
93 sub public($) { 102 sub public($) {
94 my $info = shift; 103 my $info = shift;
95 $info->{access} = ACCESS_PUBLIC; 104 $info->{access} = ACCESS_PUBLIC;
96 my $implementor = delete $info->{implementor}; 105 my $implementor = delete $info->{implementor};
97 $implementor->Implement($info); 106 $implementor->Implement($info);