scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

Top level: Default for string chopping should be much larger

Open UWN opened this issue 5 years ago • 4 comments

?- length(L,11).
   L = [_A,_B,_C,_D,_E,_F,_G,_H,_I,_J|...].  % OK
?- X = "abcdefghijklmnopqrstuvwxyz".
   X = "abcdefghijklmnopqrs ...".

Much more should be printed! At least 4 times the size of the printing depth

UWN avatar Apr 22 '20 09:04 UWN

@mthom: This is not an enhancement. It is extremely irritating, everytime I want to use Scryer, I need to resort to atom_chars/2 to convert the list into an atom. Then, for some reason you do not have a problem with limitations.

And: do not write out valid syntax since this can be easily misinterpreted.

UWN avatar Aug 20 '21 13:08 UWN

If you want to see the entire string, you can press w on the toplevel to print it:

?- X = "abcdefghijklmnopqrstuvwxyz" ; 0=1.
   X = "abcdefghijklmnopqrs ..." % press w
   X = "abcdefghijklmnopqrstuvwxyz"
;  false.

triska avatar Aug 20 '21 16:08 triska

Thanks, and there is no way to get that behavior by default?

UWN avatar Aug 20 '21 17:08 UWN

Is this w thing really a good solution? After all it produces a non-sensical transscript.

UWN avatar Jan 15 '22 18:01 UWN

Here is an even odder phenomenon:

?- [user].
q("abcdefghijklmnopqrstuvwxyz").
q(E+t):-q(E).

?- q(L).
   L = "abcdefghijklmnopqrs ..."
;  L = "abcdefghijklmnopqr ..."+t % does this make sense? And all below
;  L = "abcdefghijklmnopq ..."+t+t
;  L = "abcdefghijklmnop ..."+t+t+t
;  L = "abcdefghijklmno ..."+t+t+t+t
;  L = "abcdefghijklmn ..."+t+t+t+t+t
;  L = "abcdefghijklm ..."+t+t+t+t+t+t
;  L = "abcdefghijkl ..."+t+t+t+t+t+t+t
;  L = "abcdefghijk ..."+t+t+t+t+t+t+t+t
;  L = "abcdefghij ..."+t+t+t+t+t+t+t+t+t
;  L = "abcdefghi ..."+t+t+t+t+t+t+t+t+t+t
;  L = "abcdefgh ..."+t+t+t+t+t+t+t+t+t+t+t
;  L = "abcdefg ..."+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "abcdef ..."+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "abcde ..."+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "abcd ..."+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "abc ..."+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "ab ..."+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "a ..."+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = "abcdefghijklmnopqrstuvwxyz"+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t % big surprise
;  L = ... +t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  L = ... + ... +t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t+t
;  ... .

UWN avatar May 06 '23 09:05 UWN

I have filed #1988 so that the default can be configured with the Prolog flag answer_write_options.

Example:

?- Cs = "abcdefghijklmnopqrstuvwxyz".
   Cs = "abcdefghijklmnopqrs ...".
?- set_prolog_flag(answer_write_options, [max_depth(100)]).
   true.
?- Cs = "abcdefghijklmnopqrstuvwxyz".
   Cs = "abcdefghijklmnopqrstuvwxyz".

triska avatar Sep 03 '23 09:09 triska