From a-doug@microsoft.com  Wed Aug  9 20:23:51 2000
Received: from mail2.microsoft.com (mail2.microsoft.com [131.107.3.124])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id UAA25272
	for <prolog@swi.psy.uva.nl>; Wed, 9 Aug 2000 20:23:50 +0200 (MET DST)
Received: from 157.54.9.104 by mail2.microsoft.com (InterScan E-Mail VirusWall NT); Wed, 09 Aug 2000 11:22:55 -0700 (Pacific Daylight Time)
Received: by INET-IMC-02 with Internet Mail Service (5.5.2651.58)
	id <P26GPK6K>; Wed, 9 Aug 2000 11:22:43 -0700
Message-ID: <E713F2760348D211A9B600805F6FA1AB09509A8A@RED-MSG-09.itg-messaging.redmond.corp.microsoft.com>
From: "Douglas Miles (Volt Computer)" <a-doug@microsoft.com>
To: "'prolog@swi.psy.uva.nl'" <prolog@swi.psy.uva.nl>
Subject: RE: Predicate Determining the  port in which was called.
Date: Wed, 9 Aug 2000 11:23:39 -0700 
X-Mailer: Internet Mail Service (5.5.2651.58)

Corrections: (actually i am not sure if this is correct eighter)


I want to write but do not know how is to determine the port in which a
predicate was called over:

example:

test:- member(X,[1,2,3]),mypredicate,X=4.
mypredicate:- port(call),write('% creating side effects'),nl.
mypredicate:- port(redo),write('% doing nothing'),nl.
mypredicate:- port(exit),write('% comitting side effects'),nl.
mypredicate:- port(fail),write('% undoing side effects'),nl.

Code above, i know is not logicaly even close to what it would look like :)

I want 'mypredicate' to react differently depending on what port you would
have seen in tracing.
(i do not know if this is possible)

I would want to create output like this

test.
% creating side effects
% doing nothing
% doing nothing
% comitting side effects


Thank you in advance,

	Douglas

