1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Add p5-Class-Multimethods-Pure 0.11, method-ordered multimethod

dispatch.

PR:		ports/100375
Submitted by:	Gea-Suan Lin <gslin at gslin.org>
This commit is contained in:
Cheng-Lung Sung 2006-07-17 01:09:47 +00:00
parent eb961371c0
commit 30906c9a2c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=168034
5 changed files with 57 additions and 0 deletions

View File

@ -819,6 +819,7 @@
SUBDIR += p5-Class-MethodMapper
SUBDIR += p5-Class-MixinFactory
SUBDIR += p5-Class-Multimethods
SUBDIR += p5-Class-Multimethods-Pure
SUBDIR += p5-Class-NamedParms
SUBDIR += p5-Class-ObjectTemplate
SUBDIR += p5-Class-ObjectTemplate-DB

View File

@ -0,0 +1,28 @@
# New ports collection makefile for: p5-Class-Multimethods-Pure
# Date created: 2006-07-16
# Whom: Gea-Suan Lin <gslin@gslin.org>
#
# $FreeBSD$
#
PORTNAME= Class-Multimethods-Pure
PORTVERSION= 0.11
CATEGORIES= devel perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
MASTER_SITE_SUBDIR= Class
PKGNAMEPREFIX= p5-
MAINTAINER= gslin@gslin.org
COMMENT= Method-ordered multimethod dispatch
PERL_CONFIGURE= yes
MAN3= Class::Multimethods::Pure.3
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500600
IGNORE= requires perl 5.6.0 or later. Install lang/perl5.8 then try again
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,3 @@
MD5 (Class-Multimethods-Pure-0.11.tar.gz) = 611aa6b2fe51331b40f9060fd73fbd30
SHA256 (Class-Multimethods-Pure-0.11.tar.gz) = f6c98c18870cedd556268f43bb093609f1b00ca5e039de2c09f057d88a2a4b1c
SIZE (Class-Multimethods-Pure-0.11.tar.gz) = 13056

View File

@ -0,0 +1,17 @@
You can define multimethods with the "multi" declarator:
use Class::Multimethods::Pure;
multi collide => ('Bullet', 'Ship') => sub {
my ($a, $b) = @_; ...
};
multi collide => ('Ship', 'Asteroid') => sub {
my ($a, $b) = @_; ...
};
It is usually wise to put such declarations within a BEGIN block, so
they behave more like Perl treats subs (you can call them without
parentheses and you can use them before you define them).
WWW: http://search.cpan.org/dist/Class-Multimethods-Pure/

View File

@ -0,0 +1,8 @@
@comment $FreeBSD$
%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/Multimethods/Pure/.packlist
%%SITE_PERL%%/Class/Multimethods/Pure.pm
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/Multimethods/Pure
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/Multimethods
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class
@dirrmtry %%SITE_PERL%%/Class/Multimethods
@dirrmtry %%SITE_PERL%%/Class