From jan@swi.psy.uva.nl Thu Nov 15 10:00:47 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 fAF90lt02477;
	Thu, 15 Nov 2001 10:00:47 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id fAF90lS16749;
	Thu, 15 Nov 2001 10:00:47 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: Sebastian John <sebc@cs.tu-berlin.de>, prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] PL_*_pointer
Date: Thu, 15 Nov 2001 09:58:01 +0100
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <200111141211.NAA12972@toffees.cs.tu-berlin.de>
In-Reply-To: <200111141211.NAA12972@toffees.cs.tu-berlin.de>
MIME-Version: 1.0
Message-Id: <01111510004701.16744@gollem>
Content-Transfer-Encoding: 8bit

On Wed, 14 Nov 2001, Sebastian John wrote:
>Hi
>
>Im impressed of your prolog and I want to use it in my research.
>Although Im not experienced in all details of SWI prolog Im going to
>use the foreign code interface to fasten the computation. But there
>are several problems.
>
>To simplify my problem is: going throu a set of arbitrary elements
>without a need of exploring the internal structure. The only thing is
>to compare the elements of identity. I feel the PL_get_pointer
>procedure would the shortest and fastest possibility to return me
>unique val's of such a list. But unfortunately it fails and assigns -1
>to ptr. I don't really know what this procedure dose due to the lag of
>any description. 
>
>Dose anyone know more ... or has a running sample using the
>PL_get_pointer procedure ?

Not really clean what you want, but the PL_*_pointer() functions
should be used for one purpose only: return C-pointers to Prolog
and get the pointer back in C.  Never manipulate the value in
Prolog (other than copying, storing and retrieving).

Normally you use it to give the location of a C-struct to Prolog.

	Regards --- Jan

