Did you know ... Search Documentation:
portray_text.pl -- Portray text
PublicShow source

A Prolog string is a list of character-codes: (small) integers, which results in output like this:

?- writeln("hello").
[104, 101, 108, 108, 111]

Unless you know the Unicode tables by heart, this is pretty unpleasant for debugging. Loading this library makes the toplevel and debugger print strings with at least 3 characters as "text ...". Of course, this is an ambigious operation because nobody can know whether [65,66] should be written as "AB" or a list: to Prolog they are the same. Therefore it is imported that the user is aware of the fact that this heuristic conversion is enabled. This is why this library must be loaded explicitely to enable this conversion.

To be done
- Allow setting the character-codes we try to convert
Source portray_text(+Boolean) is det
If true, write lists of character codes as "..." to simplify debugging.
Source set_portray_text(+Name, +Value) is det
Set options for writing lists as strings. Options are
Only consider lists that are at least this long
Write strings that are longer as "start...end"