Welcome! Please see the About page for a little more info on how this works.

+6 votes
in Syntax and reader by

= has a single arity returning true. Should it also have a 0 arity returning true as well?

This would be in line with the results of (and), (or), (every? odd []). And would make (apply = coll) safe in all cases, even when coll was empty.

From slack:
> Agreed - I had an #(->> xs ... (apply =)) in a fdef spec and it was failing in the case when xs is empty, forcing me to write a more verbose function.

ago by
I like that! "For all a, b in c, a = b" is vacuously true for c = empty.
Also presumeably `not=` would also have a zero-arity (and return false)

1 Answer

0 votes
ago by

What does it mean to compare 0 things?

...