Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Help with syntax ... Object::InsideOut

Reply
Thread Tools

Help with syntax ... Object::InsideOut

 
 
jps
Guest
Posts: n/a
 
      12-10-2008
Hi!

I am trying to grasp the "design pattern" of Object::InsideOut and was
reading this:
http://search.cpan.org/~jdhedden/Obj.../InsideOut.pod

Looking at the code-examples, I see things like

my @data
:Field
:Type(numeric)
:Accessor(data);

and

sub init :Init

etc.

What are these syntactic elements ":Field" and ":Init" ?
And what do they mean?

I cannot remember having seen those ":Xxxx" constructs before...
What do you call these elements, so I know what to google for?

Thanks for help!

/JP
 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      12-10-2008
jps <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Hi!
>
> I am trying to grasp the "design pattern" of Object::InsideOut and was
> reading this:
> http://search.cpan.org/~jdhedden/Object-InsideOut-

3.52/lib/Object/InsideOut.pod
>
> Looking at the code-examples, I see things like
>
> my @data
> :Field
> :Type(numeric)
> :Accessor(data);


....

> What are these syntactic elements ":Field" and ":Init" ?
> And what do they mean?


They are called attributes.

http://search.cpan.org/~jdhedden/Object-InsideOut-
3.52/lib/Object/InsideOut.pod#ATTRIBUTES

There are some built-in attributes as well:

http://perldoc.perl.org/attributes.html

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
Reply With Quote
 
 
 
 
jps
Guest
Posts: n/a
 
      12-10-2008
On Dec 10, 2:44*pm, "A. Sinan Unur" <(E-Mail Removed)> wrote:
> jps <(E-Mail Removed)> wrote innews:(E-Mail Removed):
>
> > Hi!

>
> > I am trying to grasp the "design pattern" of Object::InsideOut and was
> > reading this:
> >http://search.cpan.org/~jdhedden/Object-InsideOut-

>
> 3.52/lib/Object/InsideOut.pod
>
>
>
> > Looking at the code-examples, I see things like

>
> > * *my @data
> > * * * * * * * :Field
> > * * * * * * * :Type(numeric)
> > * * * * * * * :Accessor(data);

>
> ...
>
> > What are these syntactic elements ":Field" and ":Init" ?
> > And what do they mean?

>
> They are called attributes.
>
> http://search.cpan.org/~jdhedden/Object-InsideOut-
> 3.52/lib/Object/InsideOut.pod#ATTRIBUTES
>
> There are some built-in attributes as well:
>
> http://perldoc.perl.org/attributes.html
>
> Sinan
> --
> A. Sinan Unur <(E-Mail Removed)>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:http://www.rehabitation.com/clpmisc/


Thanks Sinan!
Very helpful!
/JP
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Checker that's better than the normal syntax checker Jacob Grover Ruby 5 07-18-2008 05:07 AM
Syntax error? What syntax error? Assignment fo default values? Mark Richards Perl Misc 3 11-18-2007 05:01 PM
Syntax bug, in 1.8.5? return not (some expr) <-- syntax error vsreturn (not (some expr)) <-- fine Good Night Moon Ruby 9 07-25-2007 04:51 PM
[ANN] SqlStatement 1.0.0 - hide the syntax of SQL behind familiarruby syntax Ken Bloom Ruby 3 10-09-2006 06:46 PM
Syntax highligth with textile: Syntax+RedCloth ? gabriele renzi Ruby 2 12-31-2005 02:44 AM



Advertisments