Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 2010 09:51:07 +0800 (CST)
From:      Gea-Suan Lin <gslin@gslin.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        gslin@gslin.org
Subject:   ports/152629: [NEW PORT] devel/p5-Data-Rmap: Recursive map, apply a block to a data structure
Message-ID:  <20101128015107.CDD6B7E81B@colo-p.gslin.org>
Resent-Message-ID: <201011280200.oAS20KSL077520@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152629
>Category:       ports
>Synopsis:       [NEW PORT] devel/p5-Data-Rmap: Recursive map, apply a block to a data structure
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 28 02:00:20 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Gea-Suan Lin
>Release:        FreeBSD 7.3-RELEASE-p2 i386
>Organization:
>Environment:
System: FreeBSD colo-p.gslin.org 7.3-RELEASE-p2 FreeBSD 7.3-RELEASE-p2 #0: Mon Jul 12 19:04:04 UTC 2010
>Description:
Recursively evaluate a BLOCK over a list of data structures (locally
setting $_ to each element) and return the list composed of the
results of such evaluations. $_ can be used to modify the elements.

Data::Rmap currently traverses HASH, ARRAY, SCALAR and GLOB reference
types and ignores others. Depending on which rmap_* wrapper is used,
the BLOCK is called for only scalar values, arrays, hashes,
references, all elements or a customizable combination.

The list of data structures is traversed pre-order in a depth-first
fashion. That is, the BLOCK is called for the container reference
before is it called for it's elements (although see "recurse" below
for post-order). The values of a hash are traversed in the usual
"values" order which may affect some applications.

If the "cut" subroutine is called in the BLOCK then the traversal
stops for that branch, say if you "cut" an array then the code is
never called for it's elements (or their sub-elements). To
simultaneously return values and cut, simply pass the return list to
cut: cut('add','to','returned');

The first parameter to the BLOCK is an object which maintains the
state of the traversal. Methods available on this object are
described in "State Object" below.

WWW:	http://search.cpan.org/dist/Data-Rmap/

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- p5-Data-Rmap-0.62.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	p5-Data-Rmap
#	p5-Data-Rmap/pkg-descr
#	p5-Data-Rmap/Makefile
#	p5-Data-Rmap/pkg-plist
#	p5-Data-Rmap/distinfo
#
echo c - p5-Data-Rmap
mkdir -p p5-Data-Rmap > /dev/null 2>&1
echo x - p5-Data-Rmap/pkg-descr
sed 's/^X//' >p5-Data-Rmap/pkg-descr << 'cca8a64d6be098bba7db5b622d151907'
XRecursively evaluate a BLOCK over a list of data structures (locally
Xsetting $_ to each element) and return the list composed of the
Xresults of such evaluations. $_ can be used to modify the elements.
X
XData::Rmap currently traverses HASH, ARRAY, SCALAR and GLOB reference
Xtypes and ignores others. Depending on which rmap_* wrapper is used,
Xthe BLOCK is called for only scalar values, arrays, hashes,
Xreferences, all elements or a customizable combination.
X
XThe list of data structures is traversed pre-order in a depth-first
Xfashion. That is, the BLOCK is called for the container reference
Xbefore is it called for it's elements (although see "recurse" below
Xfor post-order). The values of a hash are traversed in the usual
X"values" order which may affect some applications.
X
XIf the "cut" subroutine is called in the BLOCK then the traversal
Xstops for that branch, say if you "cut" an array then the code is
Xnever called for it's elements (or their sub-elements). To
Xsimultaneously return values and cut, simply pass the return list to
Xcut: cut('add','to','returned');
X
XThe first parameter to the BLOCK is an object which maintains the
Xstate of the traversal. Methods available on this object are
Xdescribed in "State Object" below.
X
XWWW:	http://search.cpan.org/dist/Data-Rmap/
cca8a64d6be098bba7db5b622d151907
echo x - p5-Data-Rmap/Makefile
sed 's/^X//' >p5-Data-Rmap/Makefile << '6842f6c7d2366c8f7679ef2be4088c9b'
X# New ports collection makefile for:	p5-Data-Rmap
X# Date created:		2010-11-28
X# Whom:			Gea-Suan Lin <gslin@gslin.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	Data-Rmap
XPORTVERSION=	0.62
XCATEGORIES=	devel perl5
XMASTER_SITES=	CPAN
XPKGNAMEPREFIX=	p5-
X
XMAINTAINER=	gslin@gslin.org
XCOMMENT=	Recursive map, apply a block to a data structure
X
XPERL_MODBUILD=	yes
XUSE_PERL5_RUN=	5.8.1+
X
XMAN3=		Data::Rmap.3
X
X.include <bsd.port.mk>
6842f6c7d2366c8f7679ef2be4088c9b
echo x - p5-Data-Rmap/pkg-plist
sed 's/^X//' >p5-Data-Rmap/pkg-plist << 'e10ff29e58981cb914b0f71d31b946e6'
X@comment $FreeBSD$
X%%SITE_PERL%%/Data/Rmap.pm
X@dirrmtry %%SITE_PERL%%/Data
e10ff29e58981cb914b0f71d31b946e6
echo x - p5-Data-Rmap/distinfo
sed 's/^X//' >p5-Data-Rmap/distinfo << '54f1da574d9e5a8394319f43d4e1f88e'
XSHA256 (Data-Rmap-0.62.tar.gz) = 66686c34dcc32e1fdb6acc1cd6bc55e4b75496c9ca850645a8e3a8953c953c48
XSIZE (Data-Rmap-0.62.tar.gz) = 10129
54f1da574d9e5a8394319f43d4e1f88e
exit
--- p5-Data-Rmap-0.62.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101128015107.CDD6B7E81B>