Re: [Rd] Making headers self-contained for static analysis

2023-03-16 Thread Lionel Henry via R-devel
People have let me know that the attachment didn't make it through. Do patches get filtered out? Please find it there: https://github.com/lionel-/r-svn/commit/e3de56798b1321a3fa8688a42bbb73d763b78024.patch I'm also happy to post it on the bugzilla if that makes sense. Best, Lionel On 3/16/23,

[Rd] Making headers self-contained for static analysis

2023-03-16 Thread Lionel Henry via R-devel
Hello, I started using clangd to get better static analysis and code refactoring tooling with the R sources (using eglot-mode in Emacs, it just works once you've generated a `compile_commands.json` file with `bear make all`). I noticed that the static analyser can't understand several header

Re: [Rd] isNamespaceLoaded() while the namespace is loading

2023-03-16 Thread Lionel Henry via R-devel
Hello, We've run into this issue multiple times and it's often a head scratcher when it happens. We are using workarounds but it would be great to fix this for R 4.3. Would an R core member have time to review the patch that we supplied in https://bugs.r-project.org/show_bug.cgi?id=18489 ? Best,

Re: [Rd] removeSource() vs. function literals

2023-03-31 Thread Lionel Henry via R-devel
If you can afford a dependency on rlang, `rlang::zap_srcref()` deals with this. It's recursive over expression vectors, calls (including calls to `function` and their hidden srcref arg), and function objects. It's implemented in C for efficiency as we found it to be a bottleneck in some

Re: [Rd] Choices to remove `srcref` (and its buddies) when serializing objects

2024-01-17 Thread Lionel Henry via R-devel
> I think one could implement hashing on the fly without any > serialization, similarly to how identical works, but I am not aware of > any existing implementation We have one in vctrs but it's not exported: https://github.com/r-lib/vctrs/blob/main/src/hash.c The main use is vectorised hashing: