Created
November 28, 2011 04:17
-
-
Save VienosNotes/1399084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
class T { | |
has $.with_accessor; | |
has $!without_accessor; | |
method new ($i as Int) { | |
self.bless(*, with_accessor => $i, without_accessor => $i); | |
} | |
method say_attr { | |
say "with: $!with_accessor"; | |
say "without: $!without_accessor"; | |
} | |
} | |
my $t = T.new(1); | |
$t.say_attr; | |
# 実行結果 | |
# | |
# perl6 class.pl | |
# with: 1 | |
# Use of uninitialized value in string context | |
# without: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment