class Point { has $.x; has $.y; method str { return $.x ~ "x" ~ $.y; } } my $point = Point.new(x => 2, y => 3); say $point.str;