yutannihilation / savvy

A simple R extension interface using Rust
https://yutannihilation.github.io/savvy/guide/
MIT License
72 stars 4 forks source link

print methods for enum overwriting my previous print implementations #191

Closed daniellga closed 6 months ago

daniellga commented 6 months ago

Hi! I see you added print S3 methods for enums, which are overwriting my previous print implementations. How could I avoid that?

yutannihilation commented 6 months ago

Oh, sorry... Hmm, I don't immediately come up with a nice idea. Can you overwrite it in your zzz.R?

yutannihilation commented 6 months ago

Maybe I can change the wrapper R file to such name as 000-wrapper.R?

daniellga commented 6 months ago

Oh, sorry... Hmm, I don't immediately come up with a nice idea. Can you overwrite it in your zzz.R?

The problem with this is I would have to wrap all my print implementations for enums in zzz.R... I think the better solution would be to make the wrapper be the first R file to be run when the package is built, like you suggested, or make the print implementation, and maybe other ones to come, optional as an argument of savvy-cli update.

yutannihilation commented 6 months ago

Thanks for the details! Now the generated wrapper file is 000-wrapper.R. I think now you can override the auto-generated one. I'll publish today or tomorrow.