[m-users.] Seeking some feedback on FFI style...

Julien Fischer jfischer at opturion.com
Sun Aug 7 18:45:32 AEST 2022



On Sun, 7 Aug 2022, Sean Charles (emacstheviking) wrote:

> Feedback changes made. I also noticed on filestat4/4 that I am using
> 'det_' versions of functions for building a dalendar date, so that
> also was a reason to remove 'will_not_throw_exception` as well I
> guess?

Yes. That said, if I were writing that predicate I would arrange things
so as to avoid potentially throwing a Mercury exception across the
Mercury-C boundary**, e.g. by having to_date/6 return a maybe(date)
value and constructing the statinfo/0 value by the caller of the foreign
code instead of using a callback within it.

(** throwing Mercury exceptions across this boundary is not supported in
general.)

Julien.


More information about the users mailing list