RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10
On 02-Jun-2003, Simon Marlow <simonmar@microsoft.com> wrote:
I can't see how to acquire a value of type T that isn't bottom.
By calling a function defined using the FFI, of course.
But the FFI lists the types that may be returned by a foreign function, and T is not one of them. Are you suggesting we ought to be able to define new primitive types? Cheers, Simon
On 02-Jun-2003, Simon Marlow <simonmar@microsoft.com> wrote:
On 02-Jun-2003, Simon Marlow <simonmar@microsoft.com> wrote:
I can't see how to acquire a value of type T that isn't bottom.
By calling a function defined using the FFI, of course.
But the FFI lists the types that may be returned by a foreign function, and T is not one of them.
Ah, I see.
Are you suggesting we ought to be able to define new primitive types?
I think it is at least worth considering. See my other message about how Mercury deals with this issue. -- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
"Simon Marlow" <simonmar@microsoft.com> writes:
Are you suggesting we ought to be able to define new primitive types?
Sorry, yes indeed that was the suggestion. Or at least, it is not so much a suggestion, as a recognition that Hugs and nhc98 already use the 'data T' mechanism for this purpose, so we should consider if there might be possible confusion when adding a mechanism to the FFI standard which has the same syntax but a different purpose. One design alternative would be to extend the FFI standard to allow the addition of new primitive types. Another design alternative would be to use different names for the primitive datatype mechanism and the empty datatype mechanism. (Way back when, nhc13 had "data primitive Int" for the former instead of "data Int", and Alastair has just suggested "foreign import data T" as a possible syntax for the latter.) Regards, Malcolm
participants (3)
-
Fergus Henderson -
Malcolm Wallace -
Simon Marlow