[Bps-public-commit] r18447 - Lorzy/trunk/lib/Lorzy/Expression

clkao at bestpractical.com clkao at bestpractical.com
Wed Feb 18 11:34:13 EST 2009


Author: clkao
Date: Wed Feb 18 11:34:13 2009
New Revision: 18447

Added:
   Lorzy/trunk/lib/Lorzy/Expression/And.pm

Log:
logical "and" expression.

Added: Lorzy/trunk/lib/Lorzy/Expression/And.pm
==============================================================================
--- (empty file)
+++ Lorzy/trunk/lib/Lorzy/Expression/And.pm	Wed Feb 18 11:34:13 2009
@@ -0,0 +1,25 @@
+package Lorzy::Expression::And;
+use Moose;
+extends 'Lorzy::Expression::ProgN';
+
+sub evaluate {
+    my ($self, $evaluator) = @_;
+    warn "==> at and!";
+    warn join(',',@{$self->nodes});
+    for (@{$self->nodes}) {
+        warn "==> eval $_ ";#.Dumper($_);use Data::Dumper;
+        my $ret =$evaluator->evaluated_result($_);
+#        my $ret = $_->evaluate($evaluator);
+        warn $ret;
+        $ret or return 0;
+#        or return 0;
+        warn "==> done $_";
+    }
+    return 1;
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
+



More information about the Bps-public-commit mailing list