I was thinking partition with a special pad.  You would then yield out all but the last (like you do here) and then strip values off of the last.  

But this is just as complicated as what's going on here and it's not clear that one implementation should-depend-on / is-less-fundamental-than the other.