# Surprising result with equals dot dot

**URL:** <https://swi-prolog.discourse.group/t/surprising-result-with-equals-dot-dot/4989>\
**Category:** Help!\
**Tags:** functor\
**Created:** [February 7, 2022, 8:27pm UTC](https://swi-prolog.discourse.group/t/surprising-result-with-equals-dot-dot/4989 "2022-02-07T20:27:24Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [February 8, 2022, 9:57am UTC](https://swi-prolog.discourse.group/t/surprising-result-with-equals-dot-dot/4989/9 "2022-02-08T09:57:30Z")

</div>

My favorite demonstration about the pitfalls of comma lists (as seen somewhere on the internets):

```prolog
?- [A, B] = [A, B, C].
false. % of course

?- (A, B) = (A, B, C).
B = (B, C). % WAT?

```

Coming from a language that has “tuples” this second query should come as a nasty surprise. It also shows why comma lists are not tuples in the widely accepted meaning of the word “tuple”.

And of course `[]` (the empty list) is a thing while `()` (the empty tuple?) is not a thing, as you mention.

Both Python (hugely popular) and Haskell (hugely popular in some circles) have tuples that look like `(a, b)`; and Prolog accepts this construct, and it seems to work. The end result is that you see a lot of Prolog code that uses those, some of it apparently coming from people teaching Prolog to other people, within the safe space of educational institutions.

---

_[View the full topic](https://swi-prolog.discourse.group/t/surprising-result-with-equals-dot-dot/4989)._
