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

You can easily change that behavior if you really want to.

(in-package :my-package)

(shadow 'if)

(defmacro if (condition then else) `(cl:if (true? ,condition) ,then ,else))

(defgeneric true? (thing) t)

Defining appropriate defmethods to make things work the way you want is left as an exercise.



However, wanting to is rather a problem for the psychiatrist's couch.


Why? I actually agree with the OP that conflating the empty list and the boolean false value is a mistake. (I don't think it's enough of a big deal for me to want to change it, but in a perfect world I do think it is better to distinguish them.)




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

Search: