chocolateboy / autobox Goto Github PK
View Code? Open in Web Editor NEWCall methods on native types
Home Page: https://metacpan.org/release/autobox
License: Artistic License 2.0
Call methods on native types
Home Page: https://metacpan.org/release/autobox
License: Artistic License 2.0
Windows 11 22H2, Strawberry Perl 5.32.1
Below is demo script. If you comment out that use autobox;
line, it works great. But with use autobox;
it termiates early silently.
use Parallel::ForkManager;
# comment out this line and it becomes good.
use autobox;
my $pm = Parallel::ForkManager->new(3);
$pm->run_on_finish(
sub {
my ( $pid, $exit_code, $ident, $exit_signal, $core_dump, $returned ) = @_;
print "Child with ", $returned->{id}, " finished.\n";
}
);
LOOP:
foreach my $id (0 .. 10) {
my $pid = $pm->start and next LOOP;
print "Starting with $id \n";
my $return_data = {};
$return_data->{id} = $id;
$pm->finish( 0, $return_data );
}
$pm->wait_all_children;
print "is this gonna work???\n";
In Perl 5.27.7 the right-hand side of the ~~ operator is supposed to be an object that has ~~ overloaded. So I thought that overloading ~~ on package ARRAY would let me create arrays' behaviour with ~~ as I wanted. But I found out that that does not do the trick (see my program here: https://gist.github.com/akarelas/feb1a870da15b1e729ebe718ede4d6ce )
I wonder if autobox could be modified to handle ~~ as well, or maybe there's a way to achieve what I want which I just don't know.
We have this in the cpanfile
for my project at work:
requires 'autobox', '>= 2.86';
Since 3.0.1 came out that's started to break:
Argument "^C\0^A" isn't numeric in numeric ge (>=) at ...
Pleeeeeease switch back to using numbers for versions, nothing else works reliably (yes, I'm going to report this as a bug against version.pm as well).
I was talking to somebody today on IRC, who was trying to use autobox and was being confused why none of the code in the synopsis as-is.
I think the synopsis and documentation needs to be more explict in that autobox.pm
creates none of the methods, and autobox.pm
is explicitly a toolkit for other autoboxing things to use, and that the synopsis is only an example of what could be done once all the relevant subs are installed in SCALAR::length()
etc, and that unless somebody is explicitly authoring a autoboxing module, that they should probably be consuming an existing autoboxer, like autobox::Core
or MooseX::Autobox
Hello,
a little Lintian report:
--- a/lib/autobox.pod
+++ b/lib/autobox.pod
@@ -540,7 +540,7 @@
directly on native types produces the same results as calling them with autobox disabled
e.g.:
- 42->isa('NUMBER') # "" (interpeted as "42"->isa("NUMBER"))
+ 42->isa('NUMBER') # "" (interpreted as "42"->isa("NUMBER"))
[]->can('push') # Error: Can't call method "can" on unblessed reference
=head1 EXPORTS
On 5.25.10 with -Ddefault_inc_excludes_dot
PERL_DL_NONLAZY=1 "/home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/bin/perl5.25.10" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Can't locate autobox_scope_1.pm in @INC (you may need to install the autobox_scope_1 module) (@INC contains: ../lib /home/kent/.cpanm/work/1488218060.1141/autobox-2.84/blib/lib /home/kent/.cpanm/work/1488218060.1141/autobox-2.84/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/all.t line 667.
BEGIN failed--compilation aborted at t/all.t line 667.
# Looks like your test exited with 2 before it could output anything.
t/all.t .............
Dubious, test returned 2 (wstat 512, 0x200)
It appears this crept in here:
1c44965#diff-0bf22fc49ca50df354c7619caaaa96d2R26
Despite a previous change indicating its intent to be omitted from CPAN:
version.pm is not used for core version comparisons until 5.10 or if it's loaded. So to support 5.8, version tuples should be declared like (on a single line):
use version 0.77; our $VERSION = version->declare('v3.0.0');
and version should be added to your module's runtime dependencies. See http://blogs.perl.org/users/grinnz/2018/04/a-guide-to-versions-in-perl.html under Declaring Versions, and https://metacpan.org/pod/version#How-to-declare()-a-dotted-decimal-version.
Accordng to perl5220delta, one needs to use macros to access the sibling informations
cc -c -I. -O2 -pipe -fstack-protector -fno-strict-aliasing -O3 -Wall -DVERSION=\"2.83\" -DXS_VERSION=\"2.83\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.25/mach/CORE" autobox.c
autobox.xs:31:43: error: no member named 'op_sibling' in 'struct op'
UNOP *parent = (cUNOPo->op_first->op_sibling) ? cUNOPo : ((UNOP*)cUNOPo->op_first);
~~~~~~~~~~~~~~~~ ^
autobox.xs:33:24: error: no member named 'op_sibling' in 'struct op'
OP *o2 = prev->op_sibling;
~~~~ ^
autobox.xs:36:31: error: no member named 'op_sibling' in 'struct op'
for (cvop = o2; cvop->op_sibling; cvop = cvop->op_sibling);
~~~~ ^
autobox.xs:36:56: error: no member named 'op_sibling' in 'struct op'
for (cvop = o2; cvop->op_sibling; cvop = cvop->op_sibling);
~~~~ ^
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.