From owner-svn-ports-head@FreeBSD.ORG Sun Apr 26 12:28:08 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CED6D934; Sun, 26 Apr 2015 12:28:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCE021FC0; Sun, 26 Apr 2015 12:28:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QCS8HE001111; Sun, 26 Apr 2015 12:28:08 GMT (envelope-from sunpoet@FreeBSD.org) Received: (from sunpoet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3QCS7EV001098; Sun, 26 Apr 2015 12:28:07 GMT (envelope-from sunpoet@FreeBSD.org) Message-Id: <201504261228.t3QCS7EV001098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sunpoet set sender to sunpoet@FreeBSD.org using -f From: Sunpoet Po-Chuan Hsieh Date: Sun, 26 Apr 2015 12:28:07 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r384782 - in head/devel: . p5-constant-defer X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 12:28:08 -0000 Author: sunpoet Date: Sun Apr 26 12:28:06 2015 New Revision: 384782 URL: https://svnweb.freebsd.org/changeset/ports/384782 Log: - Add p5-constant-defer 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. 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/ Added: head/devel/p5-constant-defer/ head/devel/p5-constant-defer/Makefile (contents, props changed) head/devel/p5-constant-defer/distinfo (contents, props changed) head/devel/p5-constant-defer/pkg-descr (contents, props changed) head/devel/p5-constant-defer/pkg-plist (contents, props changed) Modified: head/devel/Makefile Modified: head/devel/Makefile ============================================================================== --- head/devel/Makefile Sun Apr 26 12:28:00 2015 (r384781) +++ head/devel/Makefile Sun Apr 26 12:28:06 2015 (r384782) @@ -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 Added: head/devel/p5-constant-defer/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/p5-constant-defer/Makefile Sun Apr 26 12:28:06 2015 (r384782) @@ -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 Added: head/devel/p5-constant-defer/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/p5-constant-defer/distinfo Sun Apr 26 12:28:06 2015 (r384782) @@ -0,0 +1,2 @@ +SHA256 (constant-defer-6.tar.gz) = 7b21263198ca22686efff3ae987a240be423dd2160afdeb29fe716d032986ffa +SIZE (constant-defer-6.tar.gz) = 43427 Added: head/devel/p5-constant-defer/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/p5-constant-defer/pkg-descr Sun Apr 26 12:28:06 2015 (r384782) @@ -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/ Added: head/devel/p5-constant-defer/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/p5-constant-defer/pkg-plist Sun Apr 26 12:28:06 2015 (r384782) @@ -0,0 +1,2 @@ +%%SITE_PERL%%/constant/defer.pm +%%PERL5_MAN3%%/constant::defer.3.gz