Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lists of functions, confused

Status
Not open for further replies.

hep84

Programmer
May 2, 2010
9
US
hey guys, I am currently a noob to swi-prolog. I've been trying to figure out bunch of things and I was working on some questions in the beginner book I bought... I got stuck on some of them. I hope to get some help in here since this is one of the best ones I found.

Code:
remove_duplicates(+List, -NewList)
Succeeds with NewList equal to List with all the duplicates in List removed, leaving just a single copy of each distinct element in List (the order in which the elements appear in NewList does not matter). If List is not a list, it fails.

delete_first(+X, +List, -NewList)
Succeeds with NewList equal to List, with the first occurrence of X in List deleted. If X does not occur in the list List, succeeds with NewList equal to List. If List is not a list, it fails.

I appreciate the help... Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top