I know I wrote it, but this routine sucks. In terms of big-oh efficiency, it takes O(n^{2}) operations on an n-element list, in the worst case. There's gotta be a better way to do this (and it probably relies on clever use of built-in commands, because accessing each element one-by-one is slow).

First Non-Zero Element / Discussion

This is the discussion related to the wiki page First Non-Zero Element.