Jan Wielemaker wrote:
> On Friday 03 July 2009 03:45:31 pm Tobias Kuhn wrote:
>> Is there a simple way to print out operators in normal predicate form (as
>> write_canonical/1 does) but print out lists with the []-notation (as
>> write/1 does)? This would solve my problem too.
>
> AFAIK, the options that are shared with the standard or current practice
> are compatible. The big question is still: what are you trying to do? If
> it is about exchanging terms to another language you probably end up
> with a partial solution if you try to tweak Prolog write. Use the XML
> writer, JSON generator, etc. or roll your own.
My program should read a file containing Prolog terms (describing a grammar), transform those terms
into another Prolog-based format, and write the transformed terms into another file. Both, input and
output, contain terms of the form "<(A,B)" where "<" is used to describe some kind of a backwards
reference having two arguments. It makes no sense to write "<(A,B)" in infix notation "A<B", neither
in the input file nor in the output file.
Using e.g. "<<<" instead of "<" would solve the problem. But for reasons of conciseness I would
prefer "<".
> The `best' route in SWI-Prolog is probably to make cancelation of
> operators work inside modules. Afterall, the fact that that doesn't work
> must be considered a bug.
This would perfectly solve my problem.
Tobias
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog