----- Original Message -----
From: "Richard A. O'Keefe" <ok@xxxxxxxxxxxxxx>
To: <prolog@xxxxxxxxxxxxxx>
Sent: Friday, December 16, 2005 1:54 PM
Subject: Re: [SWIPL] VERY URGENT, CUT AND FINDALL/3
Richard,
> "Andrew_Days (sent by Nabble.com)" <lists@xxxxxxxxxx>
> asked about
> > And I want to know a program write a list who not belongs
> > simultaniosly a two lists, and i want to use findall/3.
> > For example:
> > A=[1,2,3,4,5,6].
> > B=[3,4,8,7,6,1].
> > L=[2,5,8,7].
>
>
> No, you DON'T want to use findall/3.
>
> Whyever would you want to do that?
>
<SNIP>
Perhaps because his instructor asked him to use it ?
As you've quite clearly and comprehensively pointed out, the use of
findall/3 is a most inefficient means of finding the "symmetric difference
of two sets". However, the posing of this problem does provide a simple
introduction to the use of findall/3. Having successfully solved such a
problem the way is then paved for more complex applications, as well as a
deeper understanding, of findall/3 [and its brethren].
To my mind this is another example of 'bad code' having its uses [at least
in a teaching context].
Cheers,
Anthony Borla
|