develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35917 - trunk/examples/pir

From:
julianalbo
Date:
January 23, 2009 12:23
Subject:
[svn:parrot] r35917 - trunk/examples/pir
Message ID:
20090123202258.632B9CB9AE@x12.develooper.com
Author: julianalbo
Date: Fri Jan 23 12:22:57 2009
New Revision: 35917

Modified:
   trunk/examples/pir/pirric.pir

Log:
pirric: pass arguments to functor calls

Modified: trunk/examples/pir/pirric.pir
==============================================================================
--- trunk/examples/pir/pirric.pir	(original)
+++ trunk/examples/pir/pirric.pir	Fri Jan 23 12:22:57 2009
@@ -885,6 +885,24 @@
 .end
 
 #-----------------------------------------------------------------------
+.sub get_args_and_call :method
+    .param pmc tokenizer
+    .param pmc fun
+
+    .local pmc args, result
+
+    args = self.'get_args'(tokenizer)
+    $I0 = defined args
+    unless $I0 goto emptyargs
+    result = fun(args :flat)
+    goto done
+emptyargs:
+    result = fun()
+done:
+    .return(result)    
+.end
+
+#-----------------------------------------------------------------------
 .sub eval_base :method
     .param pmc tokenizer
     .param pmc token :optional
@@ -990,10 +1008,11 @@
 
 isfunctor:
     #say 'Functor'
-    args = self.'get_args'(tokenizer)
-    $P3 = var()
+
+    $P3 = self.'get_args_and_call'(tokenizer, var)
     .return($P3)
 
+
 dotted:
     $P3 = tokenizer.'get'()
     $P4 = tokenizer.'get'()



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About