comparison Lib/IMPL/lang.pm @ 271:56364d0c4b4f

+IMPL::SQL::Schema::MySQL: added basic support for MySQL
author cin
date Mon, 28 Jan 2013 02:43:14 +0400
parents f48a1a9f4fa2
children 8d36073411b1
comparison
equal deleted inserted replaced
270:3f59fd828d5f 271:56364d0c4b4f
6 use IMPL::_core::version; 6 use IMPL::_core::version;
7 use IMPL::clone qw(clone); 7 use IMPL::clone qw(clone);
8 8
9 require IMPL::Class::PropertyInfo; 9 require IMPL::Class::PropertyInfo;
10 10
11 our @EXPORT = qw(&is); 11 our @EXPORT = qw(&is &isclass);
12 our %EXPORT_TAGS = ( 12 our %EXPORT_TAGS = (
13 base => [ 13 base => [
14 qw( 14 qw(
15 &is 15 &is
16 &clone 16 &clone
17 &isclass
17 ) 18 )
18 ], 19 ],
19 20
20 declare => [ 21 declare => [
21 qw( 22 qw(
60 our @EXPORT_OK = keys %{ { map (($_,1) , map (@{$_}, values %EXPORT_TAGS) ) } }; 61 our @EXPORT_OK = keys %{ { map (($_,1) , map (@{$_}, values %EXPORT_TAGS) ) } };
61 62
62 use IMPL::Const qw(:all); 63 use IMPL::Const qw(:all);
63 64
64 sub is($$) { 65 sub is($$) {
65 eval { $_[0]->isa( $_[1] ) }; 66 eval {ref $_[0] and $_[0]->isa( $_[1] ) };
67 }
68
69 sub isclass {
70 eval {not ref $_[0] and $_[0]->isa( $_[1] ) };
66 } 71 }
67 72
68 sub virtual($) { 73 sub virtual($) {
69 $_[0]->Virtual(1); 74 $_[0]->Virtual(1);
70 $_[0]; 75 $_[0];