p5-constant-defer: add version 6

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.
This commit is contained in:
markd 2022-05-31 20:49:09 +00:00
parent 6e58104a28
commit fa9d208816
4 changed files with 31 additions and 1 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3742 2022/05/24 05:54:01 wiz Exp $
# $NetBSD: Makefile,v 1.3743 2022/05/31 20:49:09 markd Exp $
#
COMMENT= Development utilities
@ -2176,6 +2176,7 @@ SUBDIR+= p5-capitalization
SUBDIR+= p5-circular-require
SUBDIR+= p5-common-sense
SUBDIR+= p5-constant-def
SUBDIR+= p5-constant-defer
SUBDIR+= p5-curry
SUBDIR+= p5-enum
SUBDIR+= p5-ex-lib

View file

@ -0,0 +1,8 @@
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.

View file

@ -0,0 +1,16 @@
# $NetBSD: Makefile,v 1.1 2022/05/31 20:49:09 markd Exp $
DISTNAME= constant-defer-6
PKGNAME= p5-${DISTNAME}
CATEGORIES= devel perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=../../authors/id/K/KR/KRYDE/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://metacpan.org/release/constant-defer
COMMENT= constant subs with deferred value calculation
LICENSE= gnu-gpl-v3
PERL5_PACKLIST= auto/constant/defer/.packlist
.include "../../lang/perl5/module.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -0,0 +1,5 @@
$NetBSD: distinfo,v 1.1 2022/05/31 20:49:09 markd Exp $
BLAKE2s (constant-defer-6.tar.gz) = 061fad1a566551a57ca780f4eb77159ed1fc0cdd86882f8d206e93895a64c369
SHA512 (constant-defer-6.tar.gz) = 902916d32ed11737d34f8764af171ba1731de807ffbfd62e342f83bef05ab0a34ddaeec3f2c9b41814877b0568fc3e09fbf26e7ce2cd4a3dd6eeba75e6755b5f
Size (constant-defer-6.tar.gz) = 43427 bytes