class Car {
has Str $.make;
has Str $.model;
has UInt $.year where * > 1885;
}
multi set-car(Car $car where .make.defined) {
say "With only make: ", $car
}
multi set-car(Car $car where .model.defined) {
say "With only model: ", $car
}
multi set-car(Car $car) {
say "Any car: ", $car
}
set-car Car.new: :make<Fiat>;
set-car Car.new: :model<Uno>;
set-car Car.new:
:make<Fiat>,
:model<Uno>,
:year(2002),
;