I apologize for the formatting, that should be:

jl_value_t *ret = jl_eval_string(code_string);
void* array_type = jl_array_eltype(ret);
jl_array_t *ret_array = (jl_array_t*)ret;

if (jl_typeis(array_type, jl_int64_type)) {
  long *data = (long*) jl_array_data(ret_array);
}
else if (jl_typeis(array_type, jl_float64_type)) { 
  double *data = (double*) jl_array_data(ret_array);
}


And the issue is that even if it is an Int64 or Float64, neither of those 
IF statements will return true.


On Sunday, 16 October 2016 21:36:03 UTC-4, Kyle Kotowick wrote:
>
> Awesome, thanks. Could you show how to use it in a minimal code example? 
> Here's what I'm currently trying, but it does not appear to be working:
>
> jl_value_t *ret = jl_eval_string(code_string);
> void* array_type = jl_array_eltype(ret);
> jl_array_t *ret_array = (jl_array_t*)ret;
>
>
>
> if (jl_typeis(array_type, jl_int64_type)) {
>  long *data = (long*) jl_array_data(ret_array);
> }
> else if (jl_typeis(array_type, jl_float64_type)) { double *data = (double
> *) jl_array_data(ret_array);
> }
>
>
> On Friday, 14 October 2016 20:45:18 UTC-4, Isaiah wrote:
>>
>> On Fri, Oct 14, 2016 at 2:28 PM, Kyle Kotowick <ky...@kotowick.ca> wrote:
>>>
>>>
>>> After determining that an array was returned, how would you determine 
>>> what the inner type of the array is (i.e. the type of the objects it 
>>> contains)?
>>>
>>
>> `jl_array_eltype`
>>  
>>
>>>
>>> And furthermore, if it returns an array of type "Any", would there be 
>>> any way to tell what the type is of any arbitrary element in that array?
>>>
>>
>> `jl_typeof`, after retrieving the element (which will be boxed)
>>  
>>
>>>
>>> Thanks!
>>>
>>
>>

Reply via email to