News for hackers. Stuff that matters.
Re:The Loudest Lisp Program by kgwgk on Friday May 03, 2024 @02:22AM (#40244719)
> (2) In many (most?) day-to-day cases, the distinction isn't material, and for those the ecosystem is going to end up preferring one more than the others (which may change over time - hence, 'in vogue'). The references I've seen tend to suggest sticking to (eq) and (equal), for instance, and avoiding (eql) unless you have specific need of it.

I guess they suggest two instead of one because in most cases the difference is material. And I imagine that they also suggest using = to compare numbers.

When the distinction doesn’t matter one could just use eq. I’m not sure that this covers most uses though.

Re:The Loudest Lisp Program by kazinator on Friday May 03, 2024 @09:53AM (#40247688)
If you want to test whether x is 1.0 or 1, then (= x 1) is what you want. But = is specific to numbers and blows up on non-numbers.

The family of functions whose names begin with eq are special in that they are applicable to all objects; equal will tell you that "abc" is not 1 without complaining.

Re:The Loudest Lisp Program by kgwgk on Friday May 03, 2024 @11:11AM (#40248590)
But - with the exception of equalp - they may fail to identify as equal numbers which are equal (=). I suggested to use = to compare numbers specifically.