diff options
author | az <az@FreeBSD.org> | 2011-06-06 17:27:32 +0800 |
---|---|---|
committer | az <az@FreeBSD.org> | 2011-06-06 17:27:32 +0800 |
commit | c89fe925a07b34400f383c15bdd1a77b4e79fbb4 (patch) | |
tree | 861df7dbc26ffbb2241cb988f1048c6f5e9ac12e /devel | |
parent | 642c6e65c702d96f9ad720775b19d7dba4b43b04 (diff) | |
download | freebsd-ports-gnome-c89fe925a07b34400f383c15bdd1a77b4e79fbb4.tar.gz freebsd-ports-gnome-c89fe925a07b34400f383c15bdd1a77b4e79fbb4.tar.zst freebsd-ports-gnome-c89fe925a07b34400f383c15bdd1a77b4e79fbb4.zip |
String eval is often used for dynamic code generation. For instance, Moose uses
it heavily, to generate inlined versions of accessors and constructors, which
speeds code up at runtime by a significant amount. String eval is not without
its issues however - it's difficult to control the scope it's used in (which
determines which variables are in scope inside the eval), and it can be quite
slow, especially if doing a large number of evals.
This module attempts to solve both of those problems. It provides an
eval_closure function, which evals a string in a clean environment, other than
a fixed list of specified variables. It also caches the result of the eval, so
that doing repeated evals of the same source, even with a different
environment, will be much faster (but note that the description is part of the
string to be evaled, so it must also be the same (or non-existent) if caching
is to work properly).
Diffstat (limited to 'devel')
-rw-r--r-- | devel/Makefile | 1 | ||||
-rw-r--r-- | devel/p5-Eval-Closure/Makefile | 29 | ||||
-rw-r--r-- | devel/p5-Eval-Closure/distinfo | 2 | ||||
-rw-r--r-- | devel/p5-Eval-Closure/pkg-descr | 16 | ||||
-rw-r--r-- | devel/p5-Eval-Closure/pkg-plist | 5 |
5 files changed, 53 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index ae531d8b479f..b4712f144735 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1616,6 +1616,7 @@ SUBDIR += p5-Env-PS1 SUBDIR += p5-Env-Path SUBDIR += p5-Errno + SUBDIR += p5-Eval-Closure SUBDIR += p5-Eval-Context SUBDIR += p5-Event SUBDIR += p5-Event-ExecFlow diff --git a/devel/p5-Eval-Closure/Makefile b/devel/p5-Eval-Closure/Makefile new file mode 100644 index 000000000000..e052a617e028 --- /dev/null +++ b/devel/p5-Eval-Closure/Makefile @@ -0,0 +1,29 @@ +# New ports collection makefile for: Eval::Closure +# Date created: 2011-06-06 +# Whom: Andrej Zverev <az@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= Eval-Closure +PORTVERSION= 0.06 +CATEGORIES= devel perl5 +MASTER_SITES= CPAN +MASTER_SITE_SUBDIR= CPAN:DOY +PKGNAMEPREFIX= p5- + +MAINTAINER= perl@FreeBSD.org +COMMENT= Safely and cleanly create closures via string eval + +BUILD_DEPENDS= p5-Sub-Exporter>=0:${PORTSDIR}/devel/p5-Sub-Exporter \ + p5-Try-Tiny>0:${PORTSDIR}/lang/p5-Try-Tiny +RUN_DEPENDS:= ${BUILD_DEPENDS} + +LICENSE_COMB= dual +LICENSE= ART20 GPLv1 + +PERL_CONFIGURE= yes + +MAN3= Eval::Closure.3 + +.include <bsd.port.mk> diff --git a/devel/p5-Eval-Closure/distinfo b/devel/p5-Eval-Closure/distinfo new file mode 100644 index 000000000000..fef5f82b9402 --- /dev/null +++ b/devel/p5-Eval-Closure/distinfo @@ -0,0 +1,2 @@ +SHA256 (Eval-Closure-0.06.tar.gz) = 2c425b6189c30dd0782c22f86e16c578b508ab78c3398edc8fbc8f7cda8b4e62 +SIZE (Eval-Closure-0.06.tar.gz) = 15676 diff --git a/devel/p5-Eval-Closure/pkg-descr b/devel/p5-Eval-Closure/pkg-descr new file mode 100644 index 000000000000..a08e85f714c2 --- /dev/null +++ b/devel/p5-Eval-Closure/pkg-descr @@ -0,0 +1,16 @@ +String eval is often used for dynamic code generation. For instance, Moose uses +it heavily, to generate inlined versions of accessors and constructors, which +speeds code up at runtime by a significant amount. String eval is not without +its issues however - it's difficult to control the scope it's used in (which +determines which variables are in scope inside the eval), and it can be quite +slow, especially if doing a large number of evals. + +This module attempts to solve both of those problems. It provides an +eval_closure function, which evals a string in a clean environment, other than +a fixed list of specified variables. It also caches the result of the eval, so +that doing repeated evals of the same source, even with a different +environment, will be much faster (but note that the description is part of the +string to be evaled, so it must also be the same (or non-existent) if caching +is to work properly). + +WWW: http://search.cpan.org/dist/Eval-Closure diff --git a/devel/p5-Eval-Closure/pkg-plist b/devel/p5-Eval-Closure/pkg-plist new file mode 100644 index 000000000000..b46203a21322 --- /dev/null +++ b/devel/p5-Eval-Closure/pkg-plist @@ -0,0 +1,5 @@ +%%SITE_PERL%%/Eval/Closure.pm +%%SITE_PERL%%/%%PERL_ARCH%%/auto/Eval/Closure/.packlist +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Eval/Closure +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Eval +@dirrmtry %%SITE_PERL%%/Eval |