Display a list in its 'raw' ./2 format
问题 Is it possible to display a Prolog list in its ./2 format, e.g. for the list: | ?- L=[a,b,c]. L = [a,b,c] ? yes Is there a means to display: L = .(a, .(b, .(c, []))). 回答1: Normally, write_canonical(List) or ?- write_term(List, [quoted(true), ignore_ops(true)]) , as pointed out in the comments. Since SWI-Prolog decided to do things differently, this is not good enough: ?- write_canonical([a]). [a] true. ?- write_term([a], [quoted(true), ignore_ops(true)]). [a] true. ?- write_term([a],