summaryrefslogtreecommitdiffhomepage
path: root/perl6.html.markdown
diff options
context:
space:
mode:
authorTheDmitry <TheDmitry@users.noreply.github.com>2015-01-26 10:55:19 +0300
committerTheDmitry <TheDmitry@users.noreply.github.com>2015-01-26 10:55:19 +0300
commit5f0f3e992c3d6303bf0d8f70d3cf9ca2d6d56431 (patch)
tree7c8c7d404666816144810fac7435e6602c587ec1 /perl6.html.markdown
parentb60ed50cdd5ed990bf2b88d6be6f1e6e1cd2775e (diff)
parent553bf62f896f22d8cab43e127693a5af561fe0c7 (diff)
Merge remote-tracking branch 'upstream/master' into json-ru
Diffstat (limited to 'perl6.html.markdown')
-rw-r--r--perl6.html.markdown5
1 files changed, 2 insertions, 3 deletions
diff --git a/perl6.html.markdown b/perl6.html.markdown
index 13f383fe..72faecb6 100644
--- a/perl6.html.markdown
+++ b/perl6.html.markdown
@@ -157,7 +157,6 @@ sub named-def(:$def = 5) {
say $def;
}
named-def; #=> 5
-named-def(:10def); #=> 10
named-def(def => 15); #=> 15
# Since you can omit parenthesis to call a function with no arguments,
@@ -653,7 +652,7 @@ class A {
has Int $!private-field = 10;
method get-value {
- $.field + $!private-field + $n;
+ $.field + $!private-field;
}
method set-value($n) {
@@ -671,7 +670,7 @@ class A {
# Create a new instance of A with $.field set to 5 :
# Note: you can't set private-field from here (more later on).
my $a = A.new(field => 5);
-$a.get-value; #=> 18
+$a.get-value; #=> 15
#$a.field = 5; # This fails, because the `has $.field` is immutable
$a.other-field = 10; # This, however, works, because the public field
# is mutable (`rw`).