Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calculate something in a checkup and eventually return that calculation
;; Instead of doing
(if (and (some? "checking if displaying it should even be considered")
(some->> txt (vector :div))
(some->> txt (vector :div)))
;; => [:div txt]
;; Consider doing
(and (some? "checking if displaying it should even bbe considered")
(some->> txt (vector :div))
;; => [:div txt]
@werenall
Copy link
Author

Although this is smart, and smaller LOC-wise, I'm worried about code readability. It may not be obvious at the first glance that and returns either the first falsey it encountered or the the return value of the last clause.
That said, should this snippet be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment