I am trying to understand the following code, in particular the set method::
use v6; class Point { has $.x = 0; has $.y = 0; method gist { "[$.x, $.y]" } method set( :$x = $.x, :$y = $.y ) { $!x = $x; $!y = $y; } }
Can someone explain all of the syntax used in the set method?
And, another question if I may: is "Learning Perl 6" outdated?
Thanks.
In reply to Raku classes: syntax question by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |