Article View: comp.lang.prolog
Article #47Re: How to pick elements out of lists?
From: Bernard Silver
Date: Tue, 03 Nov 1992 13:19
Date: Tue, 03 Nov 1992 13:19
23 lines
1698 bytes
1698 bytes
In article <PLUMMER.92Nov2210156@nutmeg.cs.swarthmore.edu> plummer@cs.swarthmore.edu (David Barker-Plummer) writes: [About selecting pairs, using member/2 or select/3.] Your criticism is completely correct, and your code works, although the conventional name for your member/3 predicate is select/3. I interpreted "every pair of elements in every order" to mean that (a,b) and (b,a) should both appear, although on closer insepection this appears to be contradicted by the clause "the order of the pair itself is not important". I read this latter as meaning that it didn't matter what order the pairs were produced. More significantly (perhaps!) Dave's code would produce pair(X,X) for every X that appeared just once in the list, whereas the select-based code wouldn't. Who knows which the original poster wanted! -- Bernard Silver GTE Laboratories bsilver@gte.com (617) 466-2663
Technical Details
Message-ID:
<BERNARD.92Nov3081910@sirius.gte.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!know!hri.com!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!noose.ecn.purdue.edu!samsung!transfer!ceylon!newshost!bernardReferences:
<1992Oct29.140104.7751@coli.uni-sb.de> <1992Nov1.053612.7414@usage.csd.unsw.OZ.AU> <PLUMMER.92Nov1091801@nutmeg.cs.swarthmore.edu> <ANDKA.92Nov2103650@aste12.IDA.LiU.SE> <PLUMMER.92Nov2210156@nutmeg.cs.swarthmore.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!know!hri.com!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!noose.ecn.purdue.edu!samsung!transfer!ceylon!newshost!bernard From: bernard@sirius.gte.com (Bernard Silver) Newsgroups: comp.lang.prolog Subject: Re: How to pick elements out of lists? Message-ID: <BERNARD.92Nov3081910@sirius.gte.com> Date: 3 Nov 92 13:19:10 GMT References: <1992Oct29.140104.7751@coli.uni-sb.de> <1992Nov1.053612.7414@usage.csd.unsw.OZ.AU> <PLUMMER.92Nov1091801@nutmeg.cs.swarthmore.edu> <ANDKA.92Nov2103650@aste12.IDA.LiU.SE> <PLUMMER.92Nov2210156@nutmeg.cs.swarthmore.edu> Sender: news@ceylon.gte.com Organization: GTE Laboratories Incorporated Lines: 23 In-reply-to: plummer@cs.swarthmore.edu's message of 3 Nov 92 02:01:56 GMT