Search code examples
prologprolog-toplevel

How do you change 'write_options' in prolog to print a long list?


By default, SICStus Prolog will only display the first ten elements of a list (after which it shows ...).

How do you make Prolog display all the elements of a long list? I have tried:

set_prolog_flag(toplevel_print_options,
    [quoted(true), portray(true), max_depth(100), priority(699)]).

but I get the message

expected write_option, but found portray(true)

Solution

  • Your problem is that the option portray is invalid, it should be portrayed.

    I think this will do:

    set_prolog_flag(toplevel_print_options,
        [quoted(true), portrayed(true), max_depth(0)]).
    

    with max_depth(0) being no limit, that is what I guess you are looking for.