[Previous] [Up]
Go backward to Functor Errors
Go up to Common Errors

Other Common Mistakes

Other common functor mistakes withing goals are shown below, along with the error diagnoses provided by the SICStus interpreter. Check the examples to verify that you know what is wrong in each case--this isn't always obvious from Prolog's response.

Forgotten Brackets

| ?- parent(a, b, X = f.
 
** , or ) expected in arguments **
parent ( a , b , X = f
** here **
.
 
| ?- member(a, [a,b,c).
 
** , | or ] expected in list **
member ( a , [ a , b , c
** here **
) .
 

Forgotten Commas

| ?- parent(a,b) X = f.
 
** variable follows expression **
parent ( a , b )
** here **
X = f .
 
| ?- parent(a b),X = f.
 
** atom follows expression **
parent ( a
** here **
b ) , X = f .
 

Space After Predicate Name

| ?-  parent (a,b).
 
** bracket follows expression **
parent
** here **
 ( a , b ) .
| ?-

<a.von.klopp@bangor.ac.uk>

[Previous] [Up]