I find I tend to need intermediate variables. In Clojure that's in the form of let bindings, like cmp-result-1 and cmp-result-2 in the following function.(defn str-cmp    Takes two strings and compares them. Returns the string if a match; and nil if not.    [str-1 str-2 start-pos substr-len]    (let [cmp-result-1 (subs str-1 start-pos substr-len)          cmp-result-2 (subs str-2 start-pos substr-len)]        (compare cmp-result-1 cmp-result-2))) I could re-write this function without them, but to me, the function's purpose looks clearer. I tend to do this quite in a bit in my main, and that is primarily for debugging purposes, so I can pass a variable to print out intermediate output. Is this bad form, and, if so, why?Thanks.
Is it bad form to stage a function's steps in intermediate variables (let bindings)?
clojure
Nah. For arbitrary functions composed of N intermediary variables, the maximum complexity is exponential in N, if not higher. Intermediate variables most definitely allow for highly complex functions to be expressed cleanly.