Created
December 31, 2010 16:17
-
-
Save edoloughlin/761119 to your computer and use it in GitHub Desktop.
if-let treating nil as true?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; I've got | |
| (if-let [session (last (find @*sessions* session-token))] | |
| (something) (something-else)) | |
| ; The (last (find @*sessions* session-token)) expression evaluates | |
| ; to nil but (something) is then evaluated when I would expect | |
| ; that (something-else) should be evaluated. What gives? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment