Hi,

I had the pleasure to implement the series operator (&infix:<...>) in
Rakudo(*), and came across the difficulty to come up with a signature
for it. These are the use cases I want to cover:

1, 2 ... { $^a + $^b }
1 ... { $_ + 1 }

The first one can clearly be written as

sub infix:<...>(@values, Code $geneator)

but the second will fail to bind to that signature, because the 1 isn't
a list. I'd like to write

sub infix:<...>(*...@values, Code $generator)

instead, but I think that required positional parameters are forbidden
after slurpy arrays. Do I have to install another multi that accepts a
single scalar? Or is there a neat trick to cover both use cases with a
single signature?


(*) Of course only the eager version works for now, ie the closure must
return a null list at some point

Cheers,
Moritz

Reply via email to