BSD Ports

devel/p5-Class-Method-Modifiers 2.15 MidnightBSD

Provides Moose-like method modifiers

System
MidnightBSD
Repository
mports
Maintainer
[email protected]
License
artistic, gpl+
Categories
devel, perl5

Description

Method modifiers are a powerful feature from the CLOS (Common Lisp Object System) world.

In its most basic form, a method modifier is just a method that calls $self->SUPER::foo(@_). I for one have trouble remembering that exact invocation, so my classes seldom re-dispatch to their base classes. Very bad!

Class::Method::Modifiers provides three modifiers: before, around, and after. before and after are run just before and after the method they modify, but can not really affect that original method. around is run in place of the original method, with a hook to easily call that original method.

One clear benefit of using Class::Method::Modifiers is that you can define multiple modifiers in a single namespace. These separate modifiers don't need to know about each other. This makes top-down design easy. Have a base class that provides the skeleton methods of each operation, and have plugins modify those methods to flesh out the specifics.

In short, Class::Method::Modifiers solves the problem of making sure you call $self->SUPER::foo(@_), and provides a cleaner interface for it.

In the other systems

SystemPortVersion
MidnightBSDdevel/p5-Class-Method-Modifiers2.15
FreeBSDdevel/p5-Class-Method-Modifiers2.15
OpenBSDdevel/p5-Class-Method-Modifiers2.15
NetBSDdevel/p5-Class-Method-Modifiers2.15nb4
DragonFlydevel/p5-Class-Method-Modifiers2.15

Install

Binary package:

mport install p5-Class-Method-Modifiers

From mports:

cd /usr/mports/devel/p5-Class-Method-Modifiers && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	p5-Class-Method-Modifiers>0:devel/p5-Class-Method-Modifiers

Dependencies

Configuration

No options to configure.

USES
perl5
Service scripts
none

Files

pkg-plist 2
  • %%SITE_PERL%%/Class/Method/Modifiers.pm
  • %%PERL5_MAN3%%/Class::Method::Modifiers.3.gz
distinfo 1
FileSizeSHA256
Class-Method-Modifiers-2.15.tar.gz4116765cd85bfe475d066e9186f7a8cc636070985b30b0ebb1cde8681cf062c2e15fc
Master sites 1
  • CPAN