aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-20 02:15:47 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-20 02:15:47 +0200
commitc0a20410d550295727026a41d31b222a246f3d6a (patch)
treea104379e4a92a5dd84266b4d20943d733fd7b459
parentChange cross-product to take any number of lists. (diff)
downloadcalp-c0a20410d550295727026a41d31b222a246f3d6a.tar.gz
calp-c0a20410d550295727026a41d31b222a246f3d6a.tar.xz
Add group prodedure.
-rw-r--r--module/util.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/util.scm b/module/util.scm
index bb1fdcd5..d54ad07b 100644
--- a/module/util.scm
+++ b/module/util.scm
@@ -501,6 +501,11 @@
(and=>> (and=> value proc)
rest ...)]))
+(define-public (group list width)
+ (unless (null? list)
+ (let* ((row rest (split-at list width)))
+ (cons row (group rest width)))))
+
(define-syntax let-env