Closed ghost closed 10 years ago
Sorry, it looks like you cover this optimisation later on the chapter. The definition just looked weird to a non-beginner, maybe the drop_value
definition as presented is more natural to beginners in your experience, I've no idea.
FWI, the function you are proposing is not tail recursive.
Yep, looks like I managed to mess my commit up as well as miss the explanation later in the chapter. I meant to commit an accumulator-based drop_value
. Sigh.
drop_value
inlists_and_patterns
seems, for no reason, to not be tail recursive. I found that confusing. If there is a good reason, should it not be discussed a bit in the book?