develooper Front page | | Postings from April 2015

Re: new Stream Test::Simple question, XS requirement

Thread Previous | Thread Next
James E Keenan
April 25, 2015 23:10
Re: new Stream Test::Simple question, XS requirement
Message ID:
On 04/25/2015 05:57 PM, bulk88 wrote:
> Since Test::Stream::Context's core design uses weaken() everywhere, that
> means new Test::Simple always requires XS building (for Scalar::Util),
> which means it will never run on miniperl, and hence, new Test::Simple
> will never be in Perl core, is my understanding correct?
> I am asking this since if new Test::Simple is not PP clean and never
> will be, there are couple places I would like to throw XS at (the
> accessors in Test::Stream::HashBase::Meta in particular).

The use of functions defined in Scalar-List-Util and implemented via XS 
inside the definitions of functions in other libraries which are 
distributed with Perl 5 core happens not to be frequent but is not, 
AFAIK, forbidden.

 From the top of a checkout of the core distro (Linux syntax for xargs):

find cpan/ -type f -name '*.xs' | \
   sort | \
   cut -d '/' -f1,2 | \
   xargs  -I % find % -type f -name '*.pm' | \
   xargs grep -n -E '(use|require)\s+(Scalar|List)::Util' | \
   grep -v Scalar-List-Utils

This shows that Compress-Raw-Bzip2's test suite uses 
Scalar::Util::dualvar.  Scalar::Uti::dualvar is also used inside Socket 
to formulate an error message in one situation.

Scalar-List-Utils's Changes file states that 'weaken()' was added at 
some point before version 1.14.  Scalar-List-Utils v1.14 was first 
distributed with a *production* version of Perl 5 in v5.8.5.  Hence, 
there might be a limit to the backwards compatibility of a new 
Test-Simple distribution.

Thank you very much.
Jim Keenan

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About