Sid Burn

  • About: I blog about Perl, C# and programming in general.
Subscribe to feed Recent Actions from Sid Burn

  • Timm Murray commented on mop problem 5 - Role and C3 searching is not always necessary

    I can see why he's confused--in Perl, roles are often implemented via multiple inheritance under the hood. The other way to do it (off the top of my head) is to mess with the symbol table, which is a nastier solution.

    That's an implementation detail, though. The semantic details of roles avoid the problems we usually associate with multiple inheritance. It's not a particularly leaky abstraction; you can pretend you have no idea how the implementation actually works and you'll be fine.

  • Ovid commented on mop problem 5 - Role and C3 searching is not always necessary

    Roles are not multiple inheritance at all. In multiple inheritance, you're overloading class responsibility with code reuse and you introduce ordering problems (which C3 mitigates but does not solve).

    Roles leave responsibility to the classes, but handle the code reuse. Further, unlike inheritance, they don't have ordering issues, ambiguities become compile-time failures, and they can be mixed and matched in any order without breaking (well, that's actually traits; Moose roles miss a few objectives here, but only in corner cases). I strongly suggest you read up more about ro…

  • Stevan Little commented on mop problem 5 - Role and C3 searching is not always necessary

    C3 will not be part of the MOP, it is part of the core of Perl already, it will be possible for a user of the MOP to use C3 just as it is possible for a user to do that with regular Perl OO.

    Roles are not multiple inheritance and in the MOP will not be implemented with multiple inheritance. You should do some reading up on Roles and how they work, I fear you do not understand them well enough.

  • xmikew commented on Method Privacy in Perl

    I got really caught off guard by:

    They don't need to be documented. Rather, they need to be urinated on to mark your territory.

    The post was heavy then I hit that line and had to laugh. Thanks, good way to start off the day

  • Yuki Kimoto commented on Sorry, my understanding of role is not enough

    My idea is that role can only provide methods. This advantage is :

    1: We don't need to learn new syntax BUILD/DEMOLISH.
    2. We can use overriding of new method. sub new { shift->SUPER::new(@_) }
    3. We can use DESTROY mehtod.
    4. We don't need to think about internal data. We can only think about methods.

    Single inheritance is not bad. I think current perl inheritance syntax should be used on mop.

Subscribe to feed Responses to Comments from Sid Burn

About is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.