[Cc’ed to new forum]
write_canonical does help with operators, but yes, it’d be useful if there was a form that expanded a list.
If interop is a problem, maybe add write_very_canonical that does ‘[|]’
You can write lists in the standard canonical representation using
1 ?- write_term([a,b,c], [dotlists(true)]).
.(a,.(b,.(c,[])))
This is a very poor format. Not only does it exhibit something that
should IMO have remained hidden, but reading this is really expensive
as you only know that the .(a, …) reduces to a ./2 cell and not a
./3 or more cell at the very end. This implies you have to carry
around a lot of information while parsing such lists. Compare that
with [a,b,c] where you can reduce after every comma.
Now working with XSB which arrived rather late on the ISO
standardization. They apparently never bothered with this and
simply write [a,b,c] for a list using write_canonical/1.
Cheers --- Jan