bbatsov / emacs-lisp-style-guide

A community-driven Emacs Lisp style guide
1.08k stars 53 forks source link

The t/:else in `cond`s #29

Closed Fuco1 closed 6 years ago

Fuco1 commented 9 years ago

Personally, I use the :otherwise keyword as found in haskell and some other (functional) languages. :else should be reserved for if/else chains, so I agree :else is not a good choice there. But how about other keywords? It once happened to me that I had to test if the parameter was t literally (which you have to do with comparing symbols), so t in the branch might lead to confusion with case (where you are matching the symbol itself).

But that's a very rare situation so in practice it shouldn't make much difference. Still, I like to use descriptive arguments anywhere where t is expected.

Malabarba commented 9 years ago

A cond form is pretty easy to read, using a keyword doesn't really add anything compared to t. I have no problem with people using things like :otherwise, but I think the guide should just follow emacs source here, given that there's no big advantage either way.