Wait, PDL has users? Glad you figured it! Another option would be just to 
depend on the version of PDL that introduced that (2.064). In pure-C land, I’d 
suggest having your code use “trans_parent”, and #if PDL_CORE_VERSION < 19 then 
#define that to “trans” (since there are likely to be fewer false positives 
that way round).

Another name-change that just got pushed to the repo: “threading” (the 
confusing, ambiguous name) has just been changed to the now-standard 
“broadcasting”. I could feel confusion that I didn’t realise I was experiencing 
lift as I went through the updating.

Best regards,
Ed

From: David Mertens<mailto:dcmertens.p...@gmail.com>
Sent: 13 February 2022 04:56
To: pdl-devel<mailto:pdl-devel@lists.sourceforge.net>
Subject: Re: [Pdl-devel] C #define to indicate PDL version?

Nevermind, found it: PDL_CORE_VERSION

On Sat, Feb 12, 2022 at 11:26 PM David Mertens 
<dcmertens.p...@gmail.com<mailto:dcmertens.p...@gmail.com>> wrote:
Hello everyone,

PDL::Parallel::threads has users! Who knew?? And apparently they've encountered 
problems!

The problem is that PDL::Parallel::threads won't compile after Ed's commit 
ee1ca955be<https://github.com/PDLPorters/pdl/commit/ee1ca955be> on September 
14, 2021. That commit changed the pdl data structure's "trans" member to 
"trans_parent." The name change clarifies the meaning of the struct field and I 
like it. The reason this is a problem is that it provides a quick way to check 
if a piddle is a slice or not: non-null means slice. PDL::Parallel::threads can 
only share data from piddles that actually own their data, so I check before 
sharing.

No problem, I'll just write code using two different names and pick the right 
one using  #if PDL_VERSION < whatever. This way my code can be compiled against 
both older and new PDLs..... wait a second, we don't appear to #define the PDL 
version anywhere. Hrmph.

Of course, if pressed, I could change my threads.xs file to be 
threads.xs.PL<http://threads.xs.PL>, and check the actual version number of 
PDL, or I could modify my Build script to check the PDL version and patch the 
xs file. But both of those seem overhanded.

Does PDL provide a preprocessor macro with this information? Thanks!
David

--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan


--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

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

Reply via email to