[m-dev.] pragma stub proposal

Ian MacLarty maclarty at csse.unimelb.edu.au
Thu Aug 13 14:02:19 AEST 2009


On Thu, Aug 13, 2009 at 1:53 PM, Peter Wang<novalazy at gmail.com> wrote:
> On 2009-08-13, Ian MacLarty <maclarty at csse.unimelb.edu.au> wrote:
>> % Now define det_error, so we can throw an exception in the stub
>> without getting a warning:
>> :- pred det_error(string::in, io::di, io::uo) is det.
>> det_error(Msg, !IO) :-
>>     ( semidet_succeed ->
>>         error(Msg)
>>     ;
>>         true
>>     ).
>>
>> % Now define the stub for non-Java grades:
>> jdbc_get_dbms_name(_, "", -1, "", !IO) :- det_error("non-Java grade", !IO).
>>
>> I guess this isn't too bad really.
>
> The problem is that you must provide fake output arguments, sometimes
> which is not that easy (foreign types).
>

Yes.  That's why I had to add the dummy Mercury types.

Ian.

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



More information about the developers mailing list