trealla icon indicating copy to clipboard operation
trealla copied to clipboard

List processing at fault

Open flexoron opened this issue 1 year ago • 4 comments

?- 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

flexoron avatar Oct 02 '24 10:10 flexoron

Interesting...

?- X = [1,f (2),3].
Error: syntax error, operator expected before parens, user:1
?- X = [1,'f' (2),3].
   X = [1,f|2].
?- 

infradig avatar Oct 02 '24 23:10 infradig


?- L = ['f' (.)]. % fixed
Error: syntax error, operator expected before parens, user:1

?- L = ['.' (f)]. % foxed
   L = ['.'|f].
?- 

flexoron avatar Oct 03 '24 11:10 flexoron

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].

flexoron avatar Oct 03 '24 12:10 flexoron

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
?- 

flexoron avatar Oct 03 '24 12:10 flexoron

This seems fixed...

 $ tpl
?- op(1,fy,'.').
   true.
?- L = ['.' ('.')].
   L = ['.' ('.')].
?- 

infradig avatar Jun 20 '25 01:06 infradig