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

Term expansion is applied twice #2603

Open
hurufu opened this issue Oct 5, 2024 · 3 comments
Open

Term expansion is applied twice #2603

hurufu opened this issue Oct 5, 2024 · 3 comments

Comments

@hurufu
Copy link
Contributor

hurufu commented Oct 5, 2024

Expansion is applied twice for every term, which is not ok, if there are any side-effects like in #2602. This leads to duplicated warnings on the console.

@triska
Copy link
Contributor

triska commented Oct 5, 2024

I cannot reproduce this. For instance, with:

term_expansion(a, b) :- write(hello).

a.

I get, upon consulting:

hello

Could you please include a test case? Thank you a lot!

@hurufu
Copy link
Contributor Author

hurufu commented Oct 5, 2024

It is quite hard to find minimal example, but this program produces duplicated output when consulted:

:- use_module(library(format)).

user:term_expansion(G, _) :-
    portray_clause(G),
    false.

x :-
    a.

b, c.

Here is an output:

$ scryer-prolog x.pl -g halt.
x :-
   a.
b,c.
b,c.
   error(permission_error(modify,static_procedure,(',')/2),load/1).

Duplicated b,c. is unexpected.

@triska
Copy link
Contributor

triska commented Oct 5, 2024

Thank you! Even the following shorter program shows the issue:

x.

b, c.

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