On Tue, Jan 28, 2020 at 15:06 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote:
> On 2020-01-28 11:59, Trey Harris wrote: > > > > > > On Tue, Jan 28, 2020 at 14:55 ToddAndMargo via perl6-users > > <perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote: > > > > No I am really confused: > > > > What part of > > > > my int8 $u = 0xF8; $u.range > > > > is not following > > > > method range(--> Range:D) > > > > ? > > > > Unless you’re getting the line `method range(--> Range:D)` from > > somewhere else, you’re looking at > > https://docs.raku.org/routine/range, which says > > > > > Documentation for method |range| assembled from the following types: > > > > > class X::OutOfRange <https://docs.raku.org/routine/range#___top> > > > > `int8` is not an `X:OutOfRange` object (which is an Exception), so it > > can’t participate in the method you reference. > > > > Okay, I think I get it. I missed the "X:OutOfRange" > and expected the qualifier to be in the definition line. > > What exactly is "X:OutOfRange" anyway? With a single colon? Nothing; I typo’d. Assuming we both meant “X::OutOfRange”.... That text is a link; if you click it to go to https://docs.raku.org/type/X::OutOfRange you’ll see that it’s an exception, specifically an “Error due to indexing outside of an allowed range”. All core class Exception objects, as a matter of convention, start with `X::`. It is frequently the case that Exceptions carry in their payloads references to the data structure that gave them trouble, so the accessor methods to reference them (such as `range`) frequently overlap with the names of constructors (at least, case-insensitively). So on a routine auto-generated page, you’ll frequently see methods on `X::...` objects; they almost never go along with the other non-exception versions of that routine name. (And, in case you were unaware, _every_ page in the /routine/... doc tree is autogenerated from content elsewhere; those headers and links are added to get you back to the context where the content canonically appears.)