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

+8 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.

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

What does it mean to compare 0 things?

How is this different from adding, and-ing or or-ing 0 things?