Hello everyone!
I am trying to get the name of composite type fields in version 1.11.
A long time ago I did it like this:
int nfields = jl_datatype_nfields(jtype);
fields.resize(nfields);
for (int i = 0; i < nfields; i++) {
jl_symbol_name(jl_field_name(jtype,i));
}
But now in julia.h there is no function jl_field_name. I try to use jl_field_names
jl_svec_t *vn = jl_field_names(jtype);
for (int i = 0; i < nfields; i++) {
jl_value_t* name = jl_svecref(vn, i);
const char *c = jl_string_ptr(name);
}
but I get nonsense instead of names. What is the correct path in current versions?