Menu

#22 PDL::PP Warnings

open
nobody
None
3
2024-05-06
2010-02-22
No

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
}

Discussion

  • Chris Marshall

    Chris Marshall - 2010-08-01

    Lower priority---this is not on the PDL-2.4.7 critical path.

     
  • Chris Marshall

    Chris Marshall - 2010-08-01
    • priority: 5 --> 3
     
  • mohawk

    mohawk - 2024-05-06

    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 $iisframe in an error message in PDL::Graphics::IIS. Until PP parses Code "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_numbers scheme, for ultra-shiny reporting, and adds which pp_def gave the problem for when it's in the middle of a huge .pd file.

     

Log in to post a comment.

MongoDB Logo MongoDB