B = [1, 2]
B = [1|2]
Why is ?- B=[1|]. not B=[1|] ?
Thanks for any answers.
Because as in Lisp, a list in Prolog is of the form [H | T] where T is a list.
[1|2] is not a proper list, it's equivalent as (1.2) in Lisp.
B = [1 | ] is the same as [1 | [2 | ]]
I got it.
Programming is something that I hate, but can not help it, I still gotta do it. you know - school assignment.
Its so tough man.
Thanks for the answer! was facing same query but could not find an answer to it..very useful post.
Thank god there are some guys who can help me do my homework