On 2022-01-20 3:35 a.m., H.Merijn Brand wrote: > With signatures and named arguments, this is much more complicated than > the example you give: > > method foo (Int :$x, Int :$y = 42, Bool :$z = False) { > } > > foo (x => 1, z => False); > foo (y => 42, :$z); > > You cannot use arity to check *what* named argument was passed and if > it was assigned a default value or if the caller passed the default > value. And now we're on a tangent that was also important to me, which is that I feel support for native named parameters is important, and while current signatures doesn't have them. It would be great if what becomes non-experimental with signatures now is something that doesn't have design decisions that would block the later addition of named parameters. Named parameters are generally the most elegant way to support what would otherwise be alternative sets of positional parameters or optional parameters, and they are generally the most elegant way to design constructors or multi-property-setters. -- Darren DuncanThread Previous | Thread Next