[m-users.] Documenting univ data passing to and from the C FFI

Fabrice Nicol fabrnicol at gmail.com
Sat May 22 16:03:43 AEST 2021


>
>      :- type myuniv
>           --->    b(bool)
>           ;       i(int)
>           ;       f(float)
>           ;       s(string).
>
> That would avoid your use of RTTI operations to look up type names and
> the resulting calls to strcmp() in the bodies of the various
> compose_to_univ_* foreign_procs.
>
> (Aside: looking at the R documentation it seems that R's ints are
> 32-bit, so perhaps that should be int32 above not an int.)
>

You're both right and I'll soon be changing this over.

As for R's int type, yes it is oddly enough int32. This is a well-known
obsolescence issue with R. There are R team proposals to move this to int64
but as far as I can tell these have not been implemented. In the forward
sense (Mercury to R) this raises an acknowledged issue that I have not
dealt with so far for Mercury ints bigger than int32 max size. It's on my
todo list.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20210522/0d327b77/attachment.html>


More information about the users mailing list