Last active
December 24, 2015 15:29
-
-
Save minikomi/6820847 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define groups-of | |
(case-lambda | |
[(n lst) (groups-of n n lst)] | |
[(n step lst) | |
(cond | |
[(empty? lst) '()] | |
[(< (length lst) n) (list lst)] | |
[else (cons (take lst n) (groups-of n step (drop lst step)))])])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment