I'm new to prolog. This is a hypothetical question - I realize it has no practical use. But I'm trying to figure out how to get Prolog to behave one way if a "no" return is received, and another if a "yes" is received.
I'm trying to write a function gothrough that takes a list, checks to see if the head of the list is equal to ',' and if it is, passes it to another function checkit. checkit checks to see if that passed variable is equal to ';'. If it is, it returns yes. If not, it returns no. I want gothrough to understand this return value and act accordingly. I understand that prolog doesn't actually return values, but I don't really know how else to describe what I want to do....
So I have this so far:
checkit(H):- H==';'.
gothrough([H|T]):- H==',', checkit(H), /*what do put here? if/else statement depending on return value of checkit*/
Thank you!