feat(whilst): add whilst function