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

Writing operators misses a space #318

Closed
UWN opened this issue Jun 6, 2024 · 2 comments
Closed

Writing operators misses a space #318

UWN opened this issue Jun 6, 2024 · 2 comments

Comments

@UWN
Copy link

UWN commented Jun 6, 2024

?- writeq(1 is X),nl.
1 is_112
X = _112.

Expected: 1 is _112

See 7.10.5 h 1:

... In all cases, a space is output to separate an operator from its argument(s) if any ambiguity could otherwise arise.

Similarly variable_names#73.

@ichiban
Copy link
Owner

ichiban commented Jun 14, 2024

Thank you very much for reporting! Fixed in v1.2.1.

$ go install github.com/ichiban/prolog/cmd/1pl@latest
go: downloading github.com/ichiban/prolog v1.2.1
$ $(go env GOPATH)/bin/1pl
Top level for ichiban/prolog v1.2.1
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- writeq(1 is X),nl.
1 is _79
X = _79.
?- S=(1 is T),N='X',write_term(S,[quoted(true), variable_names([N=T])]),nl.
1 is X
N = 'X',
S = 1 is _90,
T = _90.
?- 

@UWN
Copy link
Author

UWN commented Jun 14, 2024

Back to perfect scores!

@UWN UWN closed this as completed Jun 14, 2024
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