[mercury-users] announced: libtiff foreign interface (caveats)

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Thu Feb 8 05:39:33 AEDT 2007

Dear Peter and Julien, you wrote:

>Use pragma foreign_type

... and Peter went further:

> e.g.
>     :- type image.
>     :- pragma foreign_type("C", image, "struct image *").
>BTW, you really should make some of your predicates take I/O states and
>return error codes.

Thanks for your comments of the tiff interface module.  I've done a new
release with the 'pragma foreign_type' change and have put up the
new version (it's sweet: no cast warnings!).

Peter, as for using !IO, I understand the idiom well enough within
pure Mercury code I suppose, but I don't see an application here.
Moreover, if callers do not have the !IO handle locally, then it seems
to me to increase the burden on them (requiring them to pass
around an !IO just to access the protocol). Would you edify me with 
more detail as to what you mean?  What are the advantages of
requiring an io state for this protocol?

As for the error codes, don't worry, that will come as the code moves
out of pre-alpha and toward production.

Doug Auclair

mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list