Skip to content

Comment on Interviews Can Be a Terrible Way to Identify Good Programmersparent

Comments

I can read just enough of that that it confuses me why it doesn't work. Care to explain?

The problem is, that

  (equal 1 1) -> t
  (equal '(1 2) '(1 2)) -> t

  (eq 1 1) -> t
  (eq '(1 2) '(1 2)) -> nil
because eq tests for the same symbol, while equal test for the same list. Member uses eq, not equal.

If we are talking Common Lisp, the default test is actually EQL. ((eq 1 1) is not necessarily T).

Ah, I see. Thanks.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.