Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Kill off has-accessor.
MOP objects consistently use _ rather than - in their names, and
Attribute is decidedly MOP. Further, every other method on it uses
the _ convention, and we still had has_accessor anyway.
  • Loading branch information
jnthn committed Dec 14, 2015
1 parent 1d96ed3 commit 03cbe70
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/Perl6/Metamodel/BOOTSTRAP.nqp
Expand Up @@ -28,7 +28,6 @@ my class BOOTSTRAPATTR {
method package() { $!package }
method inlined() { $!inlined }
method has_accessor() { 0 }
method has-accessor() { 0 }
method positional_delegate() { 0 }
method associative_delegate() { 0 }
method build() { }
Expand Down
1 change: 0 additions & 1 deletion src/core/Attribute.pm
Expand Up @@ -110,7 +110,6 @@ my class Attribute { # declared in BOOTSTRAP
}

method container() is raw { nqp::isnull($!auto_viv_container) ?? Nil !! $!auto_viv_container }
method has-accessor() { ?$!has_accessor }
method readonly() { !self.rw }
method package() { $!package }
method inlined() { $!inlined }
Expand Down
4 changes: 2 additions & 2 deletions src/core/Mu.pm
Expand Up @@ -505,7 +505,7 @@ Please refactor this code using the new Iterator / Seq interface.
my $acc_name := substr($name,2);
nqp::getattr($cloned, $package, $name) =
nqp::decont(%twiddles{$acc_name})
if $attr.has-accessor && %twiddles.EXISTS-KEY($acc_name);
if $attr.has_accessor && %twiddles.EXISTS-KEY($acc_name);
}
}
else {
Expand All @@ -526,7 +526,7 @@ Please refactor this code using the new Iterator / Seq interface.
method Capture() {
my %attrs;
for self.^attributes.flat -> $attr {
if $attr.has-accessor {
if $attr.has_accessor {
my $name = substr($attr.name,2);
unless %attrs.EXISTS-KEY($name) {
%attrs{$name} = self."$name"();
Expand Down

0 comments on commit 03cbe70

Please sign in to comment.