[Bps-public-commit] r12654 - pie/branches/named-params/lib/PIE

jesse at bestpractical.com jesse at bestpractical.com
Fri May 23 22:51:00 EDT 2008


Author: jesse
Date: Fri May 23 22:51:00 2008
New Revision: 12654

Modified:
   pie/branches/named-params/lib/PIE/Expression.pm

Log:
even less use of 'run'

Modified: pie/branches/named-params/lib/PIE/Expression.pm
==============================================================================
--- pie/branches/named-params/lib/PIE/Expression.pm	(original)
+++ pie/branches/named-params/lib/PIE/Expression.pm	Fri May 23 22:51:00 2008
@@ -99,14 +99,11 @@
 sub evaluate {
     my ($self, $evaluator) = validate_pos(@_, { isa => 'PIE::Expression'}, { isa => 'PIE::Evaluator'}, );
 
-    $evaluator->run($self->args->{condition});
-
-    if ($evaluator->result->value) {
-        $evaluator->run($self->args->{if_true});
-        return $evaluator->result->value;
+    my $truth= $self->args->{condition}->evaluate($evaluator);
+    if ($truth) {
+        return    $self->args->{if_true}->evaluate($evaluator);
         }    else { 
-        $evaluator->run($self->args->{if_false});
-        return $evaluator->result->value;
+        return $self->args->{if_false}->evaluate($evaluator);
     }
 }
 



More information about the Bps-public-commit mailing list