Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Which Perl 5 OO extension can be seen as "standard" (defacto, quasi)?

Reply
Thread Tools

Which Perl 5 OO extension can be seen as "standard" (defacto, quasi)?

 
 
Ilias Lazaridis
Guest
Posts: n/a
 
      06-15-2007
I like the very fundamental OO support of Perl 5.

constructs like "separated data/method inheritance", AUTOLOAD, give me
the freedom to implement things as I like: very generic, general and
dynamic.

But as I don't like to "develope away from standard ways to do
things", I've tried to find out which is the OO extension to use with
perl 5.

I've found this very compact one:

http://www.netalive.org/swsu/archive...ed_perl_t.html

but have immediately the problem that "self" is used instead of
"$self" and that it seems that the code adds overhead at execution
time.

Then I've seen Perl6::Bundle which bring Perl 6 stuff to Perl 5

http://www.linux-magazine.com/issue/..._6_Preview.pdf

but I don't know two things:

* how stable are those implementations?
* how many perl developer do actually use them?
* can I pick just the OO stuff out of the bundle, or are ther
dependencies?
* Is there any document which suggests which modules to use for new
projects?

Any suggestions / comments are welcome.

I summarize all results herein:

http://dev.lazaridis.com/lang/wiki/PerlOO

..

--
http://dev.lazaridis.com/lang/ticket/2

 
Reply With Quote
 
 
 
 
Michele Dondi
Guest
Posts: n/a
 
      06-16-2007
On Fri, 15 Jun 2007 09:56:33 -0700, Jim Gibson
<(E-Mail Removed)> wrote:

>> I like the very fundamental OO support of Perl 5.

>
>OO support was added in Perl 5. It didn't exist in Perl 4. That is not
>my definition of "fundamental". Perhaps you mean "primitive"


Yes I think so. In Italian too "fondamentale" can have an acceptation
akin to that one, and a naive translation may be the source for
possible confusion, albeit less so than with other words.

>> * how stable are those implementations?

>
>The reform.pm module looks very stable. It was uploaded to CPAN in Sep,
>2004 and not updated since.


Or obsolete... (I don't actually know, but that's possible!)


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
 
 
 
Ilias Lazaridis
Guest
Posts: n/a
 
      06-16-2007
On Jun 15, 7:56 pm, Jim Gibson <(E-Mail Removed)> wrote:
> In article <(E-Mail Removed). com>,
>
> Ilias Lazaridis <(E-Mail Removed)> wrote:
> > I like the very fundamental OO support of Perl 5.

>
> OO support was added in Perl 5. It didn't exist in Perl 4. That is not
> my definition of "fundamental". Perhaps you mean "primitive"


No, I meant: it gives me the fundament, on which I can build upon
nicely.

I don't feel it gives me a "basic" or a "primitive' OO support (as I
can
use the fundament to build upon)

> > constructs like "separated data/method inheritance", AUTOLOAD, give me
> > the freedom to implement things as I like: very generic, general and
> > dynamic.

>
> > But as I don't like to "develope away from standard ways to do
> > things", I've tried to find out which is the OO extension to use with
> > perl 5.

>
> You don't need an "OO extension" to do OO programming in Perl. It is
> now built into the language.

[...]

of course.

My remarks above subject the build in-support.


[...]
> > * how stable are those implementations?

[...]
> > * how many perl developer do actually use them?

[...]
> > * can I pick just the OO stuff out of the bundle, or are ther
> > dependencies?

[...]
> > * Is there any document which suggests which modules to use for new
> > projects?

[...]
> > Any suggestions / comments are welcome.

>
> I think using any extensions to the language is generally a mistake

[...] - (friendly suggestions and comments, mainly targetting language
beginners)

I summarize from your writings, the there is no OO extension available
which could be seen as a standard.

The build-in OO support of Perl5 is the today's standard.

That's fine for me personally (I alreay enjoy the freedom).

Is there possibly an community agreement on a standard accessor-
extension (e.g. "
if you have to use automated accessor generation, use CPAN:??)

..

--
http://dev.lazaridis.com/lang/ticket/2

 
Reply With Quote
 
Emmanuel Florac
Guest
Posts: n/a
 
      06-17-2007
Le Sat, 16 Jun 2007 22:30:09 +0000, Ilias Lazaridis a écrit*:

>
> Is there possibly an community agreement on a standard accessor- extension
> (e.g. "
> if you have to use automated accessor generation, use CPAN:??)


I don't know for the accessors specifically, but Moose really blows
everything else away IMHO.

--
"Dope will get you through times of no money better
than money will get you through times of no dope."
Freewheelin' Franklin.

 
Reply With Quote
 
Michele Dondi
Guest
Posts: n/a
 
      06-17-2007
On Sat, 16 Jun 2007 22:30:09 -0000, Ilias Lazaridis
<(E-Mail Removed)> wrote:

>I don't feel it gives me a "basic" or a "primitive' OO support (as I
>can
>use the fundament to build upon)


But it *is* primitive, exactly because of that: but then do not
misunderstand me, I've always been fascinated by the far reaching
consequences of such a simple model. However many feel, and rightly
so, that a more robust, pervasive OO model out of the box in which one
is not forced to build stuff that is also available out of the box in
other languages would be desirable: indeed that's why it's beeing
added to Perl 6.

>I summarize from your writings, the there is no OO extension available
>which could be seen as a standard.
>
>The build-in OO support of Perl5 is the today's standard.


Yes, it is *the* one and only standard. All of the available modules
which give you bells and whistles build upon that. Talking about them,
anyway... how 'bout Moose?!? (It is not meant as Perl-6-OO-model in
Perl 5 but borrows heavily from the former.)

>That's fine for me personally (I alreay enjoy the freedom).


Freedom is fine and all, but don't exaggerate. We recommand daily to
restrict one's own freedom in a useful manner that will help one to
prevent making common programming errors, by using strict and
warnings: with OO programming the situation is different and for the
few things I've ever really needed in that field I also followed the
DIY way, but... well, as a principle a better world should be
possible!


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
Ilias Lazaridis
Guest
Posts: n/a
 
      06-18-2007
On Jun 17, 11:21 pm, Michele Dondi <(E-Mail Removed)> wrote:
> On Sat, 16 Jun 2007 22:30:09 -0000, Ilias Lazaridis
>
> <(E-Mail Removed)> wrote:
> >I don't feel it gives me a "basic" or a "primitive' OO support (as I

[...] - (primitive etc.)

> >I summarize from your writings, the there is no OO extension available
> >which could be seen as a standard.

>
> >The build-in OO support of Perl5 is the today's standard.

>
> Yes, it is *the* one and only standard.


ok

> All of the available modules
> which give you bells and whistles build upon that. Talking about them,
> anyway... how 'bout Moose?!? (It is not meant as Perl-6-OO-model in
> Perl 5 but borrows heavily from the former.)


"Moose Perl 6 OO in Perl 5"
http://svn.pugscode.org/pugs/v6/docs/kp6-Notes.txt

> >That's fine for me personally (I alreay enjoy the freedom).

> Freedom is fine and all, but don't exaggerate. We recommand daily to

[...]

 
Reply With Quote
 
Ilias Lazaridis
Guest
Posts: n/a
 
      06-18-2007
On Jun 17, 5:54 pm, Emmanuel Florac <(E-Mail Removed)> wrote:
> Le Sat, 16 Jun 2007 22:30:09 +0000, Ilias Lazaridis a écrit :
>
> > Is there possibly an community agreement on a standard accessor- extension
> > (e.g. "
> > if you have to use automated accessor generation, use CPAN:??)

>
> I don't know for the accessors specifically, but Moose really blows
> everything else away IMHO.


* http://search.cpan.org/~stevan/Moose/
* http://search.cpan.org/~stevan/Class-MOP/ Class::MOP

I dislike the verbosity:

has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');

sub clear {
my $self = shift;
$self->x(0);
$self->y(0);
}

But the main question is again:

* how is the adoption of MOP/MOOSE?
* how much are the efforts synchronized with the original perl 6 OO
implementation?

..

--
http://dev.lazaridis.com/lang/ticket/2

 
Reply With Quote
 
Ch Lamprecht
Guest
Posts: n/a
 
      06-19-2007
Ilias Lazaridis wrote:

> I dislike the verbosity:
>
> has 'x' => (is => 'rw', isa => 'Int');
> has 'y' => (is => 'rw', isa => 'Int');

You don't need the type constraint here:
has 'x' => (is=>'rw');
has 'y' => (is=>'rw');
If that's still too verbose for you you could wrap &has and make (is=>'rw') default.
>
> sub clear {
> my $self = shift;
> $self->x(0);
> $self->y(0);
> }
>




--
use Tk;use Tk::GraphItems;$c=tkinit->Canvas->pack;push@i,Tk::GraphItems->
TextBox(text=>$_,canvas=>$c,x=>$x+=70,y=>100)for(J ust=>another=>Perl=>Hacker);
Tk::GraphItems->Connector(source=>$i[$_],target=>$i[$_+1])for(0..2);
$c->repeat(30,sub{$_->move(0,4*cos($d+=3.16))for(@i)});MainLoop
 
Reply With Quote
 
Ilias Lazaridis
Guest
Posts: n/a
 
      06-21-2007
Ch Lamprecht :
> Ilias Lazaridis wrote:
>
> > I dislike the verbosity:
> >
> > has 'x' => (is => 'rw', isa => 'Int');
> > has 'y' => (is => 'rw', isa => 'Int');

> You don't need the type constraint here:
> has 'x' => (is=>'rw');
> has 'y' => (is=>'rw');
> If that's still too verbose for you you could wrap &has and make (is=>'rw') default.


ok, like this:

hasInt 'x';
has_int 'x';

but most possibly there's a even more elegant way to provide the
default value.

thank's for the clarification.

..

--
http://dev.lazaridis.com/lang/ticket/2

 
Reply With Quote
 
Michele Dondi
Guest
Posts: n/a
 
      06-23-2007
On Mon, 18 Jun 2007 08:06:25 -0700, Ilias Lazaridis
<(E-Mail Removed)> wrote:

>"Moose Perl 6 OO in Perl 5"
>http://svn.pugscode.org/pugs/v6/docs/kp6-Notes.txt


Anyway, from
<http://search.cpan.org/~groditi/Moose-0.23/lib/Moose.pm>:

: Is Moose just Perl 6 in Perl 5?
:
: No. While Moose is very much inspired by Perl 6, it is not itself Perl
: 6. Instead, it is an OO system for Perl 5. I built Moose because I was
: tired of writing the same old boring Perl 5 OO code, and drooling over
: Perl 6 OO. So instead of switching to Ruby, I wrote Moose


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
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
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com Java 0 03-06-2008 08:11 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C++ 0 03-05-2008 08:41 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
Domain extension I haven't seen before patrick j HTML 4 10-01-2006 06:24 PM
Extension which depends on another extension Jeff Mitchell Ruby 3 06-17-2004 02:35 AM



Advertisments