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

jesse at bestpractical.com jesse at bestpractical.com
Thu May 22 11:14:15 EDT 2008


Author: jesse
Date: Thu May 22 11:14:08 2008
New Revision: 12620

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

Log:
* oops

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	Thu May 22 11:14:08 2008
@@ -8,6 +8,10 @@
    is => 'ro',
    isa => 'Str');
 
+has elements => (
+   is => 'ro',
+   isa => 'ArrayRef');
+
 has args => (
     is => 'rw',
     default => sub { {} },
@@ -22,6 +26,20 @@
 
 
 sub evaluate {
+    my ($self, $ev) = @_;
+    
+    if ($self->elements) {
+        # deprecated
+        my $func = $self->elements->[0];
+        my @exp = @{ $self->elements }[1..$#{ $self->elements }];
+        my $lambda = $ev->resolve_name($func);
+        return $ev->apply_script($lambda, @exp);
+    }
+
+    my $lambda = $ev->resolve_name($self->name);
+    return $ev->apply_script_named_args( $lambda, $self->args );
+
+    
 }
 
 



More information about the Bps-public-commit mailing list