diff _test/temp.pl @ 197:6b1dda998839

Added IMPL::declare, IMPL::require, to simplify module definitions IMPL::Transform now admires object inheritance while searching for the transformation Added HTTP some exceptions IMPL::Web::Application::RestResource almost implemented
author sergey
date Thu, 19 Apr 2012 02:10:02 +0400
parents 4d0e1962161c
children 2ffe6f661605
line wrap: on
line diff
--- a/_test/temp.pl	Mon Apr 16 17:42:54 2012 +0400
+++ b/_test/temp.pl	Thu Apr 19 02:10:02 2012 +0400
@@ -1,44 +1,29 @@
 #!/usr/bin/perl
 use strict;
-use Time::HiRes qw(gettimeofday tv_interval);
+
+package Bar;
 
-sub func {
-    1;
-}
-
-my $t0 = [gettimeofday()];
-
-for(my $i = 0; $i < 1000000; $i++) {
-    func(1);
+sub CTOR {
+	shift;
+	warn @_;
 }
 
-print tv_interval($t0),"\n";
-
-my $fn = sub { 1; };
+package Foo;
 
-$t0 = [gettimeofday()];
+use IMPL::declare {
+	require => {
+		TObject => 'IMPL::Object'
+	},
+	base => {
+		TObject => '@_',
+		-Bar => '@_'
+	}
+};
 
-for(my $i = 0; $i < 1000000; $i++) {
-    &$fn(1);
+sub hello {
+	return TObject;
 }
 
-print tv_interval($t0),"\n";
-
-sub dummy() { 0; }
-
-$t0 = [gettimeofday()];
-
-for(my $i = 0; $i < 1000000; $i++) {
-    dummy;
-}
+package main;
 
-print tv_interval($t0),"\n";
-
-$t0 = [gettimeofday()];
-
-for(my $i = 0; $i < 1000000; $i++) {
-    1;
-}
-
-print tv_interval($t0),"\n";
-
+print Foo->new(qw(one for me))->hello;
\ No newline at end of file