Displaying 6 results from an estimated 6 matches for "zap_srcref".
2023 Mar 31
2
removeSource() vs. function literals
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 applications (IIRC caching). I'd be happy to
upstream this...
2024 Jan 12
2
Choices to remove `srcref` (and its buddies) when serializing objects
...ked source code in digest package hoping to get around this issue (for example serialize(..., refhook = ...)). However, my workaround did not work. It seems that the markers to the objects are different even if I used `refhook` to force srcref to be the same. I also tried `removeSource` and `rlang::zap_srcref`. None of them works directly on nested environments with multiple functions.
I wonder how hard it would be to have options to discard source when serializing R objects?
Currently my analyses heavily depend on digest function to generate file caches and automatically schedule pipelines (to upda...
2024 Jan 17
1
Choices to remove `srcref` (and its buddies) when serializing objects
...;> around this issue (for example serialize(..., refhook = ...)).
>>> However, my workaround did not work. It seems that the markers to
>>> the objects are different even if I used `refhook` to force srcref
>>> to be the same. I also tried `removeSource` and `rlang::zap_srcref`.
>>> None of them works directly on nested environments with multiple
>>> functions.
>>>
>>> I wonder how hard it would be to have options to discard source when
>>> serializing R objects?
>>>
>>> Currently my analyses heavily depen...
2024 Jan 16
2
Choices to remove `srcref` (and its buddies) when serializing objects
...ked source code in digest package hoping to get around this issue (for example serialize(..., refhook = ...)). However, my workaround did not work. It seems that the markers to the objects are different even if I used `refhook` to force srcref to be the same. I also tried `removeSource` and `rlang::zap_srcref`. None of them works directly on nested environments with multiple functions.
>>
>> I wonder how hard it would be to have options to discard source when serializing R objects?
>>
>> Currently my analyses heavily depend on digest function to generate file caches and automat...
2023 Mar 30
2
removeSource() vs. function literals
On 30/03/2023 10:32 a.m., Ivan Krylov wrote:
> Dear R-devel,
>
> In a package of mine, I use removeSource on expression objects in order
> to make expressions that are semantically the same serialize to the
> same byte sequences:
> https://github.com/cran/depcache/blob/854d68a/R/fixup.R#L8-L34
>
> Today I learned that expressions containing function definitions also
>
2024 Jan 17
1
Choices to remove `srcref` (and its buddies) when serializing objects
...this issue (for example serialize(..., refhook = ...)).
> >>> However, my workaround did not work. It seems that the markers to
> >>> the objects are different even if I used `refhook` to force srcref
> >>> to be the same. I also tried `removeSource` and `rlang::zap_srcref`.
> >>> None of them works directly on nested environments with multiple
> >>> functions.
> >>>
> >>> I wonder how hard it would be to have options to discard source when
> >>> serializing R objects?
> >>>
> >>> Cur...