diff --git a/devel/Makefile b/devel/Makefile index c36f87c339da..bde27d6cf750 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -3239,6 +3239,7 @@ SUBDIR += p5-constant SUBDIR += p5-constant-boolean SUBDIR += p5-constant-def + SUBDIR += p5-constant-defer SUBDIR += p5-constant-lexical SUBDIR += p5-cpan-listchanges SUBDIR += p5-enum diff --git a/devel/p5-constant-defer/Makefile b/devel/p5-constant-defer/Makefile new file mode 100644 index 000000000000..0418a1994828 --- /dev/null +++ b/devel/p5-constant-defer/Makefile @@ -0,0 +1,18 @@ +# Created by: Sunpoet Po-Chuan Hsieh +# $FreeBSD$ + +PORTNAME= constant-defer +PORTVERSION= 6 +CATEGORIES= devel perl5 +MASTER_SITES= CPAN +PKGNAMEPREFIX= p5- + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Constant subs with deferred value calculation + +LICENSE= GPLv3 + +USE_PERL5= configure +USES= perl5 + +.include diff --git a/devel/p5-constant-defer/distinfo b/devel/p5-constant-defer/distinfo new file mode 100644 index 000000000000..6de154906f91 --- /dev/null +++ b/devel/p5-constant-defer/distinfo @@ -0,0 +1,2 @@ +SHA256 (constant-defer-6.tar.gz) = 7b21263198ca22686efff3ae987a240be423dd2160afdeb29fe716d032986ffa +SIZE (constant-defer-6.tar.gz) = 43427 diff --git a/devel/p5-constant-defer/pkg-descr b/devel/p5-constant-defer/pkg-descr new file mode 100644 index 000000000000..cf0a623bc9a4 --- /dev/null +++ b/devel/p5-constant-defer/pkg-descr @@ -0,0 +1,15 @@ +constant::defer creates a subroutine which on the first call runs given code to +calculate its value, and on any subsequent calls just returns that value, like a +constant. The value code is discarded once run, allowing it to be garbage +collected. + +Deferring a calculation is good if it might take a lot of work or produce a big +result but is only needed sometimes or only well into a program run. If it's +never needed then the value code never runs. + +A deferred constant is generally not inlined or folded (see "Constant Folding" +in perlop) since it's not a single scalar value. In the current implementation a +deferred constant becomes a plain constant after the first use, so may inline +etc in code compiled after that (see "IMPLEMENTATION" below). + +WWW: http://search.cpan.org/dist/constant-defer/ diff --git a/devel/p5-constant-defer/pkg-plist b/devel/p5-constant-defer/pkg-plist new file mode 100644 index 000000000000..4f62d47ffda0 --- /dev/null +++ b/devel/p5-constant-defer/pkg-plist @@ -0,0 +1,2 @@ +%%SITE_PERL%%/constant/defer.pm +%%PERL5_MAN3%%/constant::defer.3.gz