cat t.pl use v6; class C { has Int $.x is rw = 0; method foo (Int $i) { $!x += $i; return self; } method bar (Int $i) { $!x -= $i; return self; } } C.new()\ .foo(1)\ .bar(2)\ .say; $ perl6 t.pl C.new(x => -1)