develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34547 - branches/rvar/languages/perl6/src/classes

From:
pmichaud
Date:
December 28, 2008 21:05
Subject:
[svn:parrot] r34547 - branches/rvar/languages/perl6/src/classes
Message ID:
20081229050528.93D9ACB9FA@x12.develooper.com
Author: pmichaud
Date: Sun Dec 28 21:05:27 2008
New Revision: 34547

Modified:
   branches/rvar/languages/perl6/src/classes/Signature.pir

Log:
[rakudo]:  Autovivify @!params in Signature.


Modified: branches/rvar/languages/perl6/src/classes/Signature.pir
==============================================================================
--- branches/rvar/languages/perl6/src/classes/Signature.pir	(original)
+++ branches/rvar/languages/perl6/src/classes/Signature.pir	Sun Dec 28 21:05:27 2008
@@ -56,11 +56,7 @@
 
     attr['name'] = varname
     .local pmc params
-    params = getattribute self, '@!params'
-    unless null params goto have_params
-    params = new 'List'
-    setattribute self, '@!params', params
-  have_params:
+    params = self.'params'()
     push params, attr
 .end
 
@@ -72,6 +68,10 @@
 
 .sub 'params' :method
     $P0 = getattribute self, "@!params"
+    unless null $P0 goto done
+    $P0 = 'list'()
+    setattribute self, "@!params", $P0
+  done:
     .return ($P0)
 .end
 



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