Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

"our" methods?
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.

Report this thread to moderator Post Follow-up to this message
Old Post
John M. Dlugosz
04-02-08 09:14 AM


Re: "our" methods?
John 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


Report this thread to moderator Post Follow-up to this message
Old Post
Audrey Tang
04-02-08 09:14 AM


Re: "our" methods?
I 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
>
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
John M. Dlugosz
04-03-08 12:14 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL 6 Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:29 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.