Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top level: strings longer than 100 characters are just chopped off #666

Open
UWN opened this issue Feb 3, 2025 · 2 comments
Open

Top level: strings longer than 100 characters are just chopped off #666

UWN opened this issue Feb 3, 2025 · 2 comments

Comments

@UWN
Copy link

UWN commented Feb 3, 2025

?- between(99,102,N),length(L,N), append(L,_,[a|L]).
   N = 99, L = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
;  N = 100, L = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
;  N = 101, L = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
   unexpected.
;  N = 102, L = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
   unexpected.

(Wasn't there the ||... abbreviation?)

@infradig
Copy link
Contributor

infradig commented Feb 4, 2025

I've been coming to the view that what you ask for is what you get. 100 is the default for truncating things at the top level. To that end lists should probably not show |... as the truncation indicator as well. Thanks for reminding me. I realize this a complete 180 for me.

@UWN
Copy link
Author

UWN commented Feb 5, 2025

a complete 180 for me.
???

First, the answers for

?- length(L,N), append(L,_,[1|L]),N > 99.
   L = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], N = 100
;  L = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1|...], N = 101
;  ... .

are fine. You use here the atom ... with a special meaning as it is produced by many top level loops.

But for strings, your answer starting with 101 is just wrong. By showing ||... at the end, as (I believe) you did previously, you indicate that something is missing. And this could also be a valid syntax extension such that "abc"||L means [a,b,c|L].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants