Hi, Luke Palmer wrote: > sub foo (+$a, *%overflow) { > say "%overflow{}"; > } > > foo(:a(1), :b(2)); # b 2 > foo(:a(1), :overflow{ b => 2 }); # b 2
I'd think so, too. > foo(:a(1), :overflow{ b => 2 }, :c(3)); # ??? Error: Too many arguments passed to &foo? Presuming that multiple *%slurpy_hashes are allowed, I'd say that... sub bar (+$a, *%overflow, *%real_overflow) { say "[%overflow{}] [%real_overflow{}]"; } bar(:a(1), :overflow{ b => 2 }); # [b 2] [] bar(:a(1), :overflow{ b => 2 }, :c(3)); # [b 2] [c 3] But it seems to be cleaner to disallow multiply *%slurpies and just go with the error. --Ingo -- Linux, the choice of a GNU | "The future is here. It's just not widely generation on a dual AMD | distributed yet." -- William Gibson Athlon! |