Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Technically not, because a cons of two objects is not eq to another cons of the same two objects.

  (eq (cons 1 2)
      (cons 1 2))
  ;; => nil
It's memory locations, after all.


I see, fair enough. I forgot to switch out of pure functional programming/referential transparency mode for this discussion. Fine, you can take NIL to be one particular (NIL . NIL) that's different from all other (NIL . NIL)s, the only particular (NIL . NIL) that is considered a list of length 0 while all other (NIL . NIL)s are lists of length 1.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: