From jan@swi.psy.uva.nl Tue Nov 13 13:50:02 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id fADCo2t27424;
	Tue, 13 Nov 2001 13:50:02 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id fADCnxl11472;
	Tue, 13 Nov 2001 13:49:59 +0100
Date: Tue, 13 Nov 2001 13:49:59 +0100
Message-Id: <200111131249.fADCnxl11472@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] current_thread/2 behavior
To: =?koi8-r?B?5M3J1NLJyiDzLiDr1drYzcnO?= <dima@solvo.ru>,
   prolog@swi.psy.uva.nl
In-Reply-To: =?koi8-r?B?5M3J1NLJyiDzLiDr1drYzcnO?='s message of Tue, 13 Nov 2001 10:41:02 +0300 (MSK)
Phone: +31 - 20 - 525 6121

> %% 1)
> 
> ?- current_thread(asd,X).
> ERROR: thread `asd' does not exist
> 
> ?-catch(current_thread(asd,X),Error,true).
> 
> X = _G378 Error = error(existence_error(thread, asd), _G457)
> 
> Yes
> 
> %% 2)
> 
> ?- current_thread(A,X),A=asd.
> 
> No
> 
> %% Question : Why ?

I guess you want to say it is more in line with the other current_*
predicates to fail silently if the argument is of the right type, but
the object simply doesn't exist.

I changed the behaviour accordingly.  Changes (affecting only pl-thread.c)
are in the CVS repository.

	Regards --- Jan

