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

Empty list ambiguity #296

Closed
amimart opened this issue Jun 23, 2023 · 2 comments
Closed

Empty list ambiguity #296

amimart opened this issue Jun 23, 2023 · 2 comments

Comments

@amimart
Copy link

amimart commented Jun 23, 2023

Description

When comparing an empty list [] with the '[]' atom, it is considered equal.

How to reproduce

This issue can be easily reproduced using the provided interactive interpreter cmd/1pl:

?- [] = '[]'.
true

I'd be happy to have your thoughts about that, if I can be of any help it'll be a pleasure :)

@pmoura
Copy link

pmoura commented Jun 23, 2023

The empty list is an atom in ISO Prolog Core standard and in almost all Prolog systems (*). There's no bug here.

(*) The only exception is SWI-Prolog which made the (questionable and very publicly criticized decision) to make [] its own type in release 7.x.

@amimart
Copy link
Author

amimart commented Jun 23, 2023

Oh I see, thanks @pmoura :)

@amimart amimart closed this as completed Jun 23, 2023
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