SWI-Prolog (and maybe other Prolog engines) provides a predicate named portray_clause for pretty-printing clauses. I think we can use it instead of write_term to get a more readable output, which may help with debugging both the compiler and the unsafe clauses by making the output easier to navigate.
portray_clause will also simplify the code in io.pl getting rid of copying and using numbervars etc.
I can create a pull request for this next week if you are on board with such a change.
SWI-Prolog (and maybe other Prolog engines) provides a predicate named
portray_clausefor pretty-printing clauses. I think we can use it instead ofwrite_termto get a more readable output, which may help with debugging both the compiler and the unsafe clauses by making the output easier to navigate.portray_clausewill also simplify the code inio.plgetting rid of copying and usingnumbervarsetc.I can create a pull request for this next week if you are on board with such a change.