Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!ll.mit.edu!vdd.VLSI.LL.MIT.EDU!bloom-beacon.mit.edu!panix!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!agate!darkstar.UCSC.EDU!news.hal.COM!decwrl!netcomsv!netcom.com!ludemann
From: ludemann@netcom.com (Peter Ludemann)
Subject: Re: Newbie Prolog Question
Message-ID: <ludemannD0vHDw.1sx@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <3cjoo4$le8@nkosi.well.com>
Date: Thu, 15 Dec 1994 22:05:56 GMT
Lines: 19

In article <3cjoo4$le8@nkosi.well.com>,
Scott Kinard <skinard@well.sf.ca.us> wrote:
>	I have some 'facts' I have entered into a program in the form
>		fact(name,[list of items]).
>and I have need of obtaining each 'fact' from within various (I guess they
>are called) predicates, in a sequential manner. e.g. each time I say:
>	fact(Name,List).
>I want a different 'fact' to show up.

If I understand you correctly, this will do what you want:

	fact_single(Name, Fact) :-
		fact(Name, List),
		member(Fact, List).

Many Prologs have member/2 built-in.  If yours doesn't, any good
Prolog text will have the code for it.
-- 
Peter Ludemann                      ludemann@netcom.com
