Hacker News new | past | comments | ask | show | jobs | submit login

True. But consider the form:

    (if (someExpr)
      (doTrueStuff)
    )
Then a duplication of the `doTrueStuff` line would lead to true stuff being done regardless of the truthiness of someExpr (as the third [optional] argument to `if` is the else branch).

This form is not entirely unheard of either. The overtone library for example assigns labels to its event handlers like such:

   (defn eventHandler ( ...
      stuff
   ) :: event_handler_label)



This is actually why I really like `cond` in Common Lisp (and other lisps and languages). You have to make explicit what should happen if your desired expression is true, and the only way to have an `else` clause is `(t ...)` so you have to intentionally create that last wildcard spot.




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

Search: