Code Comments
Programming Forum and web based access to our favorite programming groups.In S29, there are definitions like our Capture method shape (@array: ) is export But in S12 there is no mention as to what an "our" method is. It states tha t "my" is used to make private methods, and "^" to make class methods. I think this is a doc relic and should be fixed globally in that file.
Post Follow-up to this messageJohn M. Dlugosz =B4=A3=A8=EC:
> In S29, there are definitions like
> our Capture method shape (@array: ) is export
> But in S12 there is no mention as to what an "our" method is. It state=
s that "my" is used to make private methods, and "^" to make class method=
s.
> I think this is a doc relic and should be fixed globally in that file.
S02/"Return types":
"
If a subroutine is not explicitly scoped, it belongs to the current
namespace (module, class, grammar, or package), as if it's scoped with
the C<our> scope modifier. Any return type must go after the name:
"
So this line:
our Capture method shape (@array: ) is export
is really the same as:
method shape (@array: ) of Capture is export
The prefixing of "our" is there to make the return ("of") type stand out.=
Cheers,
Audrey
Post Follow-up to this messageI understand. Thank you.
This ought to be mentioned in S12. Perhaps after the treatment on "my",
explain that "our" is the default, but saying it explicitly allows the
return type to be first.
--John
Audrey Tang audreyt-at-audreyt.org |Perl 6| wrote:
> John M. Dlugosz ´£¨ì:
>
>
> S02/"Return types":
>
> "
> If a subroutine is not explicitly scoped, it belongs to the current
> namespace (module, class, grammar, or package), as if it's scoped with
> the C<our> scope modifier. Any return type must go after the name:
> "
>
> So this line:
>
> our Capture method shape (@array: ) is export
>
> is really the same as:
>
> method shape (@array: ) of Capture is export
>
> The prefixing of "our" is there to make the return ("of") type stand out.
>
> Cheers,
> Audrey
>
>
>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.