Subject: Re: non-determinism & cleanup [was: Fwd: Non-redundant wrappers?]

From: Paul Singleton <[email-masked]>
Date: Mon, 22 May 2000 22:16:50 +0100

Paul Singleton wrote:

> OK, this idiom isn't completely general (?), but it's common enough so I've
> implemented a generic foreign predicate
> 
>   cleanup_open_get_close(OpenPredName, GetPredName, ClosePredName, In, Out) :-
>     % a PL_FA_NONDETERMINISTIC foreign function using PL_call_predicate()
>     % on OpenPredName/2, GetPredName/2, ClosePredName/1

It's been suggested I post this, so here it is (two attachments).  I believe the
structure of the code is right, and it's usable, but it needs more work to
handle modules and exceptions, at least.

My MS VC++ 5 makefile effectively compiles it like this: your mileage may vary

  CL.EXE /LD /I "$(PL_HOME)/include" $*.c "$(PL_HOME)/lib/libpl.lib"

Paul Singleton