Hi, Am 08.02.2009 um 15:47 schrieb Adrian Cuthbertson:
Here's one, I'm setting basedir to either :basedir in a map in *locs (a thread-local var) or to "." if :basedir was not found in the map... (let [basedir (if-let [bdir (:basedir *locs)] bdir ".")] ...) i.e bdir assumes the value of the test and if that is not false (or nil) returns it otherwise the else part.
This can be written more concise with get or even with :basedir alone: (let [basedir (get *locs :basedir ".")] ...) (let [basedir (:basedir *locs ".")] ...) (let [basedir (*locs :basedir ".")] ...) All but the last form work also if *locs is nil. Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature