Skip to content
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

Help with incremental conversion to OCaml values #21

Closed
wants to merge 2 commits into from

Conversation

g2p
Copy link
Contributor

@g2p g2p commented Dec 22, 2020

No description provided.

g2p added 2 commits December 22, 2020 19:34
This allows doing conversion in steps (eg, using a custom conversion to
build list elements, then converting to OCamlList) and gives more control.
@tizoc
Copy link
Owner

tizoc commented Dec 22, 2020

The Clone fix was already done in #17. What is the use case of the impl<'a, A> ToOCaml<A> for OCaml<'a, A>?

@g2p
Copy link
Contributor Author

g2p commented Dec 23, 2020

It's useful for converting containers while using something other than the normal ToOCaml implementation on every element; see this test: https://github.com/g2p/ocaml-interop/blob/ocamlbox/testing/rust-caller/src/lib.rs#L274

@tizoc
Copy link
Owner

tizoc commented Dec 23, 2020

@g2p oh I see. That makes total sense. Will come back to this once #17 is merged.

@tizoc
Copy link
Owner

tizoc commented Jan 20, 2021

Can you rebase this on top of the current master? The Clone/Copy stuff is not required anymore.

Also, note that on the new ocaml-interop OCamlAllocResult doesn't exist anymore, OCaml<T> values are now returned directly.

@g2p
Copy link
Contributor Author

g2p commented Feb 19, 2021

I'll drop this one (it didn't work well with the new lifetimes on ToOCaml, as I recall);
there's a commit in #24 that exposes cons and makes this unnecessary in the list case.

@g2p g2p closed this Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants