It appears (using this even more cut-down version, note the useful BEGIN bit 
which tells you what NiceSlice gets fed by Text::Balanced):

use PDL;
BEGIN { $PDL::NiceSlice::debug_filter = 1 }
use PDL::NiceSlice;

use strict;
use warnings;

my $p = {y=>0};

{
  my $r=zeroes((3) x 10); #ndarray
  my $empty_lines=(whichND ($r(0,,0,0,0,0,0,0;-)==0));
  {
    $empty_lines=$empty_lines(0,;-);
    my $vlines=$$p{y}-1-$empty_lines;
    $r(,$empty_lines,).=$r(,$vlines,); # syntax error
  }
}

That the trigger is being nested in two levels of {}, and having a bare key of 
“y” (which is a Perl operator, a synonym for tr///). This appears to be yet 
another bug in Text::Balanced. Still investigating.

Best regards,
Ed

From: Ed .<mailto:ej...@hotmail.com>
Sent: 24 February 2022 17:22
To: Ingo Schmid<mailto:ingo...@gmx.at>; 
pdl-devel@lists.sourceforge.net<mailto:pdl-devel@lists.sourceforge.net>
Subject: RE: [Pdl-devel] PDL 2.075 released

Hi Ingo,

I believe you didn’t run your code before emailing it, because $p isn’t 
defined. Also, I hope the real code doesn’t have an isempty followed by a 
Boolean check on ->nelem, because isempty is literally implemented as nelem == 
0.

When I adjust and experiment, the difference between a syntax error and not is 
removing the “unless ($empty_lines->isempty) {“ and matching “}”. Surprising! I 
am still investigating.

Best regards,
Ed

From: Ingo Schmid<mailto:ingo...@gmx.at>
Sent: 24 February 2022 15:18
To: pdl-devel@lists.sourceforge.net<mailto:pdl-devel@lists.sourceforge.net>
Subject: Re: [Pdl-devel] PDL 2.075 released


HI Ed,

here's some feedback to the new release. Thank you for your tireless efforts!

I experience errors in previously working code, at least in 2.074 and 2.075.

$r and $i are piddles, as are $empty_lines and $vlines. These lines (67

#!perl

use PDL;
use PDL::NiceSlice;

use 5.10.0;
use strict;

sub foo {
        my $r=shift; #piddle
        my $i=shift; #piddle

        my $empty_lines=(whichND ($r(0,,0,0,0,0,0,0;-)==0));
        unless ($empty_lines->isempty) {
                $empty_lines=$empty_lines(0,;-) if $empty_lines->nelem;
                my $vlines=$$p{y}-1-$empty_lines;
                $r(,$empty_lines,).=$r(,$vlines,); # syntax error
                $i(,$empty_lines,).=-$i(,$vlines,); # syntax error

        }
}
syntax error at /home/ingo/perl/test_errors.pl line 17, near "$r("
syntax error at /home/ingo/perl/test_errors.pl line 18, near "$i("

Could that be a PDL::NiceSlice issue?



Also, max (and probably min) are piddles now, (tested in 2.074), which breaks 
some code. They used to returen perl scalars.


On 2/19/22 10:22, Ed . wrote:
Dear PDL folks,

PDL 2.075 has just been released. Notable changes since 2.064:


  1.  threading now called broadcasting (compat aliases created)
  2.  fix when readdata functions return error (#356)
  3.  RedoDimsCode can now use $SIZE(other_index) (#386)
  4.  can now unify Code and BadCode into Code, and use PDL_IF_BAD() or #ifdef 
PDL_BAD_CODE
  5.  add macros PDL_IF_GENTYPE_{REAL,INTEGER,UNSIGNED}(iftrue,iffalse) in Code
  6.  fixes to PDL::NiceSlice including performance bug by monkey-patching 
Text::Balanced::extract_multiple
  7.  Minuit and Slatec 64-bit safe

  1.  bifuncs like Ops::plus no longer need explicit swap parameter

Future plans, in something like intended order:

  1.  fix more open GitHub issues
  2.  make PDL::LinearAlgebra work right with “native complex” (several of the 
above issues were related to enabling this)
  3.  “loop fusion” techniques to maximise locality of computation, minimising 
data’s trips through the “straw” between CPU and main RAM
  4.  finish the independent C interface for making PDL usable from e.g. Python
  5.  use OpenCL or other means to also utilise GPUs if available

The IRC channel (#pdl on irc.perl.org) is a great virtual place to come and ask 
questions, or just watch the GitHub messages flow by.

As usual, please give the new PDL a try and report problems.

Best regards,
Ed



_______________________________________________

pdl-devel mailing list

pdl-devel@lists.sourceforge.net<mailto:pdl-devel@lists.sourceforge.net>

https://lists.sourceforge.net/lists/listinfo/pdl-devel


_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to