diff 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
line wrap: on
line diff
--- a/Lib/IMPL/lang.pm	Fri Jan 25 00:25:02 2013 +0400
+++ b/Lib/IMPL/lang.pm	Mon Jan 28 02:43:14 2013 +0400
@@ -8,12 +8,13 @@
 
 require IMPL::Class::PropertyInfo;
 
-our @EXPORT      = qw(&is);
+our @EXPORT      = qw(&is &isclass);
 our %EXPORT_TAGS = (
     base => [
         qw(
           &is
           &clone
+          &isclass
           )
     ],
 
@@ -62,7 +63,11 @@
 use IMPL::Const qw(:all);
 
 sub is($$) {
-    eval { $_[0]->isa( $_[1] ) };
+    eval {ref $_[0] and $_[0]->isa( $_[1] ) };
+}
+
+sub isclass {
+    eval {not ref $_[0] and $_[0]->isa( $_[1] ) };
 }
 
 sub virtual($) {