Unify for for-to and forl into loop