Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uhccux!munnari.oz.au!mudla!ok From: ok@mudla.cs.mu.OZ.AU (Richard O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: Prolog/C Term passing Message-ID: <2745@munnari.oz.au> Date: 18 Nov 89 11:57:22 GMT References: <1790@kulcs.kulcs.uucp> Sender: news@cs.mu.oz.au Lines: 41 In article <1790@kulcs.kulcs.uucp>, alain@kulcs.uucp (Alain Callebaut) writes: > In article <2716@munnari.oz.au>, ok@mudla.cs.mu.OZ.AU (Richard O'Keefe) > talks about passing Prolog terms between Prolog and C.> > To illustrate that a hybrid program (mix of Prolog and C) does not have > to be as complicated as it is with his system, let me describe how > this all works in BIM_Prolog. I would point out that the library package I referred to is not a "finished" part of the Quintus Prolog system. The interface can and should be criticised. Callebaut shows how to do it in BIM_Prolog. (It's a lot easier in Poplog.) I'll have to take his word for it that it's "clear" and "simple" in that system. The C code doesn't appear to be any shorter. As a purely personal comment, I find doing unification in C most unclear. What happens if the unification fails? If the C code creates enough structure so that the Prolog copy stack overflows, how does the Prolog garbage collector find the C variables that refer to live structures? > It is not necessary to call two extra predicates for > converting and deallocating the externally constructed term, nor is it > necessary to perform an explicit unification of the constructed term > with the predicate's argument. The difference in the Prolog side of my example and the Prolog side of Callebaut's example is simply this: term passing is directly built into the BIM_Prolog/C interface and is not directly built into the Quintus/C interface. That's all it means. > Moreover, to my feeling, it is a violation of Netiquette > to use the net for customer support. I'm not quite sure what Callebaut means here. His address is Dept. of Computer Science, KUL. Is he speaking of his customers? ***I*** haven't any customers. I left Quintus at the end of '88. If someone asks a question on the net I really don't see why I shouldn't answer it; no-one is paying me for this. As for customer support over the net being a violation of netiquette, the Sun customers who post so many questions to comp.sys.sun and the Apollo customers who post so many questions to comp.sys.apollo would treat anyone who told Sun or Apollo not to answer any of those questions as the Bacchantes treated Orpheus.