Search code examples
listprologtruncationprolog-toplevel

list truncation: set_prolog_flag(toplevel_print_options, [max_depth(100)]) having no effect


All the questions regarding how to disable list truncation had the answer to use some variantion of this:

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

For me this does not work, see here:

?- length(L, 25).
L = [_7572, _7578, _7584, _7590, _7596, _7602, _7608, _7614, _7620|...].

?- set_prolog_flag(toplevel_print_options, [quoted(true), portray(true), max_depth(1000), priority(699)]).
true.

?- length(L, 25).
L = [_7596, _7602, _7608, _7614, _7620, _7626, _7632, _7638, _7644|...].

According to for instance this anwer, this should work:enter link description here

Has to have to do with the version of my Prolog. I am using SWI-Prolog version 7.4.2 for x86_64-darwin16.5.0. Does anyone know why this does not work with my version and how to make it work?


Solution

  • You need to use this command instead:

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

    where replaced toplevel_print_options with answer_write_options.