On Tue Jun 29 08:49:31 2010, cognominal wrote: > I would expect the following to work > > % my Range of Int $a; > Method '!select' not found for invocant of class '' > > Also a Range for Int should be provided. > I expect it to be more used than the generic version, that is overly > complicated > for simple uses with possible exclusion of min and max. > > What would be the name of the class of Range for Int? > RangeInt? > > I suppose the current class should be extended or derived > to support range that match a TotallyOrderedDiscrete role. > Such a role would support the succ and prec methods. > For range it would lead to the method truemin and truemax to be > defined so people don't have to bother with excluded value(s). >
This seems to pretty much work now. 20:55 < [Coke]> rakudo: my Range of Int $a; 20:55 <+p6eval> rakudo 63326f: ( no output ) 20:56 < [Coke]> rakudo: my Range of Str $a; 20:56 <+p6eval> rakudo 63326f: ( no output ) 20:56 < [Coke]> rakudo: my Range of Str $a; $a=1..2; 20:56 <+p6eval> rakudo 63326f: OUTPUT«Type check failed in assignment to '$a'; expected 'Range' but got 'Range' in block <anon> at /tmp/EffaNskyQY:1 in <anon> at /tmp/EffaNskyQY:1» Closable? -- Will "Coke" Coleda