Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created January 13, 2011 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/777365 to your computer and use it in GitHub Desktop.
Save amalloy/777365 to your computer and use it in GitHub Desktop.
(cond ; can be hard to tell which is a test and which is a return value
(zero? (reduce + input-values)) 0
(empty? (filter #{val1 val2 val3} (map #(foo x (nth % 4))
y)))
(some #{question answer} (last user-input))
...)
(cond ; looks weird, and leaves a complex last-form in doubt anyway
(zero? (reduce + input-values))
0
(empty? (filter #{val1 val2 val3} (map #(foo x (nth % 4))
y)))
(some #{question answer} (last user-input))
...)
(cond ; what if this were allowed? [...] is never nil, so won't conflict
(zero? (reduce + input-values)) 0
[(empty? (filter #{val1 val2 val3} (map #(foo x (nth % 4))
y)))
(some #{question answer} (last user-input))]
...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment