You On Mon, Jul 12, 2010 at 12:11 PM, Aaron Sherman via RT <perl6-bugs-follo...@perl.org> wrote: > On Sun, Jul 11, 2010 at 9:46 PM, Patrick R. Michaud <pmich...@pobox.com>wrote: > >> On Sat, Jul 10, 2010 at 04:44:40AM -0700, Stephane Payrard wrote: >> > # both statement below print 1 ad nauseam. >> > >> > say ?1..2 >> > say (?1)..2 >> >> What should the result of True..2 be? >> >> (Note that (1,2) is probably not the correct answer, as &infix:<..> >> isn't specified to coerce to numeric.) >>
>> > Isn't it a question of what the MMD takes as the more significant argument? > I would think that: > > infix:<..>(Int, Int) > > and > > infix:<..>(Bool, Bool) > > would be defined, so the question becomes which of those takes priority, > right? If it's the first parameter, then we'll try to coerce 2 to Bool, > won't we? Or is that now now it works? Currently the Range creator method does not coerce its parameters. I think Range should be a role so as to impose some constraint. I think Bool..2 should fail. This is probably a good occasion to see if roles (spec and implementation) are poweful enough to do what we expect of them, especially because Whatever is thrown in that mix. Probably the discussion belongs to p6l. Some pseudo code about what Range should be. btw #76456 does not help to see how parameterized role parse. role TotalOrder[::T] { method succ(-->T) { ... } method pred(-->T) { ... } } role Range[::T where TotalOrder | Whatever ] { has T $.min; has T $.max; ... } > > > > -- > Aaron Sherman > Email or GTalk: a...@ajs.com > http://www.ajs.com/~ajs > > -- cognominal stef