From a-doug@microsoft.com  Wed Aug  9 20:13:32 2000
Received: from mail3.microsoft.com (mail3.microsoft.com [131.107.3.123])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id UAA24602
	for <prolog@swi.psy.uva.nl>; Wed, 9 Aug 2000 20:13:31 +0200 (MET DST)
Received: from 157.54.9.100 by mail3.microsoft.com (InterScan E-Mail VirusWall NT); Wed, 09 Aug 2000 11:12:39 -0700 (Pacific Daylight Time)
Received: by INET-IMC-03 with Internet Mail Service (5.5.2651.58)
	id <Q2QXDH6F>; Wed, 9 Aug 2000 11:12:29 -0700
Message-ID: <E713F2760348D211A9B600805F6FA1AB09509A89@RED-MSG-09.itg-messaging.redmond.corp.microsoft.com>
From: "Douglas Miles (Volt Computer)" <a-doug@microsoft.com>
To: prolog@swi.psy.uva.nl
Subject: Predicate Determining the  port in which was called.
Date: Wed, 9 Aug 2000 11:13:13 -0700 
X-Mailer: Internet Mail Service (5.5.2651.58)

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('% undoing side effects. trying new side
effects'),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
% undoing side effects
% creating side effects
% undoing side effects
% creating side effects
% comitting side effects


Thank you in advance,

	Douglas

