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

[svn:parrot] r34028 - trunk/languages/perl6/src/parser

From:
jonathan
Date:
December 17, 2008 07:28
Subject:
[svn:parrot] r34028 - trunk/languages/perl6/src/parser
Message ID:
20081217152812.2F2E6CBA12@x12.develooper.com
Author: jonathan
Date: Wed Dec 17 07:28:11 2008
New Revision: 34028

Modified:
   trunk/languages/perl6/src/parser/actions.pm

Log:
[rakudo] Generate private accessor methods for attributes.

Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm	(original)
+++ trunk/languages/perl6/src/parser/actions.pm	Wed Dec 17 07:28:11 2008
@@ -2349,9 +2349,13 @@
         }
     }
 
+    # Generate private accessor.
+    my $accessor := make_accessor($/, '!' ~ ~$variable_name, $name, 1, 'attribute');
+    $class_def.push(add_method_to_class($accessor));
+
     # Twigil handling.
     if $variable_twigil eq '.' {
-        # We have a . twigil, so we need to generate an accessor.
+        # We have a . twigil, so we need to generate a public accessor.
         my $accessor := make_accessor($/, ~$variable_name, $name, $rw, 'attribute');
         $class_def.push(add_method_to_class($accessor));
     }



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