Usage of findall.

From: josh singer <josh.singer_at_parc-technologies.com>
Date: Fri 23 May 2003 03:51:29 PM GMT
Message-ID: <3E899FAFBF56D611B6A500508B9A9DA2342767@LON-SRV2>
Just a clarification of the documentation. 

According to the findall/3 bip documentation (5.4):

findall(?Term, +Goal, ?List)

... The variables appearing in Term should not appear anywhere else in the
clause except within Goal. ...

Firstly, does this mean, for example, that the following code:

....
	findall(result(X, Y, Z), do_stuff(X, Y, Z), [result(X, Y, Z)]), 
	do_something_else(X, Y, Z). 

should really be written:

....
	findall(result(GX, GY, GZ), do_stuff(GX, GY, GZ), [result(X, Y,
Z)]), 
	do_something_else(X, Y, Z). 

?

Secondly, if we went ahead with the first pattern, what would happen?

cheers, 

josh

Josh Singer
Software Developer, Parc Technologies Limited
Tel. +44 (0)207 261 4067
josh.singer@parc-technologies.com
http://www.parc-technologies.com

This e-mail message is for the sole use of the intended recipient(s)
-its contents are the property of Parc Technologies Limited (or its
licensors) and are confidential. Please do not copy, review, use
(except for the intended purposes), disclose or distribute the e-mail
or its contents (or allow anyone else to do so) without our prior
permission. Parc Technologies Limited does not guarantee that this
e-mail has not been intercepted and amended nor that it is
virus-free. You should carry out your own virus checks before opening
any attachment.  Any opinions expressed in this e-mail message are
those of the author and not necessarily Parc Technologies Limited.
Received on Fri May 23 16:48:45 2003

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:22 PM GMT GMT