develooper Front page | perl.perl5.porters | Postings from July 2007

Re: Beyond 5.10 - a new class syntax

Thread Previous | Thread Next
From:
Matt Sergeant
Date:
July 6, 2007 15:28
Subject:
Re: Beyond 5.10 - a new class syntax
Message ID:
8DDBE84F-A018-48C3-835E-5D97CFD93DC7@sergeant.org
On 30-Jun-07, at 11:43 AM, Johan Vromans wrote:

> Now 5.10 is imminent, let's think about 5.12.
>
> Some suggestions for 5.12:
>
> Application and module installer. No, not something like CPAN or
> Module::Build, but a real installer.
>
> A convenient way to build Perl modules. Module::Build is on the right
> track.
>
> A standard set of XML handling libraries so Perl can finally join the
> XML party.
>
> What do you think?

I hate all those ideas.

Instead, I'll be contraversial. Add a class keyword that works  
something like this:

class Foo isa Bar, Baz {
   my $x  # instance variable
   our $y # class variable

   sub method {
     # note no $self in here - we don't need it
     $x = 1;
     $y++;
     SUPER::method(@_);
   }

};

Yes, I know this would be a lot of work, and I'm throwing this down  
from the peanut gallery as someone who only builds CPAN modules not a  
core perl hacker. But damn, it'd be cool.

One of the reasons for the above is so that accessing instance  
variables would be fast, not a hash lookup. Hence "filter"  
implementations like Moose wouldn't really work.

Matt.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About