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

format/2 error #2790

Open
flexoron opened this issue Jan 23, 2025 · 3 comments
Open

format/2 error #2790

flexoron opened this issue Jan 23, 2025 · 3 comments

Comments

@flexoron
Copy link

I didn't check whether this is a known issue or no issue:

?- A=[f|_], write(A), nl, format("~s",[A]), nl, write(A), nl.
[f|_61]
f
[f]        % unexpected, after format variable _61 = []
   A = "f" % unexpected
;  error(instantiation_error,must_be/2).
?- 
@UWN
Copy link

UWN commented Jan 23, 2025

Shorter:

?- format("~s",[Nihil]).
   Nihil = [], unexpected
;  error(instantiation_error,must_be/2).
   instantiation_error. % expected, but not found directly

@flexoron
Copy link
Author

Hint: Issue popped up while trying to answer issue #2788

triska added a commit to triska/scryer-prolog that referenced this issue Jan 23, 2025
This addresses mthom#2790.

The issue first appeared in an example reported by @ak-1 in mthom#2788, and
was successfully analyzed by @flexoron. Many thanks!
@triska
Copy link
Contributor

triska commented Jan 23, 2025

Thank you a lot, this is absolutely an issue!

I have filed #2792 to address it, please have a look.

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

3 participants