documentcloud/underscore — pull request #844 by drd (2012-10-31 19:42:21+00:00)
Title: add _.guarded() to function functions

oftentimes a function will call or trigger an indirectly recursive application of itself. in order to avoid infinite recursion, _.guarded(fn) will wrap a function in a guard block which only allows it to be called once. if the function has already been entered, it will skip execution of the function. on exit, it will return the result of the function.