Hello. I've recently started learning prolog and am testing around some stuff.
Yesterday i got some troubles with reading a list from console. Well, i need to get a list of integers greater then zero. So i'm reading them recursively from console in the first clause and want to fall into the second clause if i read 0 which means user has finished entering the list. But in the second clause i get an error that sais that variable '_' is not completely bound. Searching around the forum didn't help at all (maybe i'm dumb, i'm really sorry if it's so). Please, could you help me just a little bit? :)
Here's a little part of the code that generates that error:
Well, more errors now :)
read_list([]) is the only clause that actually works, as the empty list is the first and most obvious one to return true. And it doesn't even make an attempt to read anything. Also it gives two warnings about unreachable code.
I tried to move this clause, and it has just brought me to a correct answer.