SWI-Prolog / issues

Dummy repository for issue tracking
7 stars 3 forks source link

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

Closed prologbyexample closed 1 year ago

prologbyexample commented 1 year ago

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.

JanWielemaker commented 1 year ago

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.