> This whole thing is probably best implemented as two separate functions
> rather than using a closure, depending on how intertwined the code paths are
> for the shortcut/non-shortcut versions.
I like the closure because it has semantic ownership: the inner
function is a worker for the outer function.
>> On Fri, Dec 11, 2015 at 8:01 PM, Franklin? Lee
>> <email@example.com> wrote:
>> > 1. Rewrite your recursive function so that the partial state is a
>> > nonlocal variable (in the closure), and memoize the recursive part.
> I'd flip the rare-case to the except block and put the normal-case in the
> try block. I believe this will be more compute-efficient and more readable.
The rare case is in the except block, though.