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

write/1 and writeln/1 missing predicate on SWISH name but wasm/native versions work as expected. #120

Closed
prologbyexample opened this issue Dec 21, 2022 · 1 comment

Comments

@prologbyexample
Copy link

prologbyexample commented Dec 21, 2022

The behaviour of write/1 and writeln/1 for clauses is different between SWISH and the WASM shell.

The following runs the same query in both environments.


On SWISH ( https://swish.swi-prolog.org ):

?- B = (H1=H2, same(T1, T2)), H1=a, H2=a, T1=[2,3], T2=[2,3], write(B).

a=a,[2, 3],2,3,[]

You can see same is missing.


On the WASM shell ( https://dev.swi-prolog.org/wasm/shell ):

?- B = (H1=H2, same(T1, T2)), H1=a, H2=a, T1=[2,3], T2=[2,3], write(B).

a=a,same([2,3],[2,3]) 

Here same is correctly printed, including the brackets ().


Also, SWI-Prolog 9.0.2 on macOS appears to work correctly.

?- B = (H1=H2, same(T1, T2)), H1=a, H2=a, T1=[2,3], T2=[2,3], write(B).

a=a,same([2,3],[2,3]) 

This looks like an bug in the normal SWISH, with the WASM version showing the correct behaviour.

@prologbyexample prologbyexample changed the title write/1 and writeln/1 missing predicate name but wasm version works as expected. write/1 and writeln/1 missing predicate on SWISH name but wasm/native versions work as expected. Dec 21, 2022
@JanWielemaker
Copy link
Member

Thanks. Fixed. SWISH write/1 does not use Prolog write/1, but a sophisticated translation of the term to HTML. That has a bug. Updated public swish.

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