Say you had an ad like:
type foo = Bar | Baz of int
How would you implement the C function to create a base? Say I declare the following:
external create_baz : int -> foo = "create_baz"
Then I will need to fill in this code:
CAMLprim value create_baz(value bar) {
}
I understand that this is pretty stupid, but it's just an example of what I'm trying to do.
source
share