-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to_ocaml to take owned self #55
base: master
Are you sure you want to change the base?
Conversation
(I think this doesn't quite work, but thought I'd at least open the conversation) |
Ok, with some extra changes, I think this largely works?? Was able to update polars-ocaml to use it in an experimental branch: mt-caret/polars-ocaml#87 |
Hi. I have to take a deeper look when I have time, but at first sight I am not very convinced about the change.
Totally agree that this is useful, but it is not what most Rust->OCaml conversions do right? such cases are rarer and are doing something more delicate by re-using in OCaml memory that lives outside of OCaml's heap, so I would rather have for such cases a different |
Thanks for taking a look at my wacky idea! That sounds like a good idea; I'll make it when I get a free moment. |
This is a rough proposal (with code!) to update
ToOCaml::to_ocaml
to takeself
instead of&self
. It also changes many default implementations ofToOCaml
to be implemented on&SomeType
instead ofSomeType
. As far as I understand it:to_ocaml
, since Rust will automatically take a reference of when calling a method on it.for <'a> &'a T: ToOCaml