Debugging PDL::PP stuff is a huge pain. It would be really nice if PDL::PP had some intelligent input-checking and could issue errors even before compiling. It would also be useful if PDL::PP could provide a function to interpret any XS compile errors, in light of the original source PD file. Ditto with the PM file.
This is a big request, but let's start with something simple. PDL::PP uses notation $ppvar(dim1 => x, ...), and when you're looping over all the explicit dimensions (or have no explicit dimensions) you get an expression like this: $ppvar(). I have forgotten to include the parentheses on more than one occasion. It would be nice if PDL::PP could check for expressions that look like pp variable accesses in which the programmer forgot the parentheses and make some noise. For example, this generates an error because I forgot to put the parentheses after $value2, and an informative message would be helpful:
while($value1() < 5 && $value2 > 10) {
// code here
}
Lower priority---this is not on the PDL-2.4.7 critical path.
Belatedly, and building on David's valuable work in giving an error on
loop %{, I tried to fix this. Unfortunately it tripped over a use of$iisframein an error message in PDL::Graphics::IIS. Until PP parsesCode"properly" (and therefore ignoring strings), this won't be possible.While working on it however, I did update the error-catching reporter to use the new
pp_line_numbersscheme, for ultra-shiny reporting, and adds whichpp_defgave the problem for when it's in the middle of a huge.pdfile.