trealla
trealla copied to clipboard
List processing at fault
?- L = ['A','B'('C')],length(L,N).
L = ['A','B'('C')], N = 2.
?- L = ['A','B' ('C')],length(L,N).
false.
?- L = ['A','B' ('C')].
L = ['A','B'|'C']. % unexpected
Interesting...
?- X = [1,f (2),3].
Error: syntax error, operator expected before parens, user:1
?- X = [1,'f' (2),3].
X = [1,f|2].
?-
?- L = ['f' (.)]. % fixed
Error: syntax error, operator expected before parens, user:1
?- L = ['.' (f)]. % foxed
L = ['.'|f].
?-
v2.56.29 Looks like some operators are involved, too
?- L = [',' (x)].
L = [','|x].
?- L = ['*->' (x)].
L = [*->|x].
?- L = ['->' (x)].
L = [->|x].
?- L = [';' (x)].
L = [;|x].
?- L = ['^' (x)].
L = [^|x].
v2.56.30 Now this, again, seems a problem:
?- L = ['.' ('.')].
Error: syntax error, operator expected before parens, user:1
?- L = ['.'('.')].
L = ['.'('.')].
?- op(1,fy,'.').
true.
?- L = ['.'('.')].
L = ['.' ('.')]. % printed but not accepted:
?- L = ['.' ('.')].
Error: syntax error, operator expected before parens, user:1
?-
This seems fixed...
$ tpl
?- op(1,fy,'.').
true.
?- L = ['.' ('.')].
L = ['.' ('.')].
?-