From b2fc6c04a77139d3936eec72a8312b455ecf182e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 20 Dec 2021 22:08:31 +0100 Subject: Documentation updates for util. --- doc/ref/guile.texi | 2 ++ module/calp/util.scm | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 8468021e..b21850bd 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -1,6 +1,8 @@ @node Guile @chapter Guile +@include guile/util.texi + @c TODO This chapter will probably in the future be replaced by a proper system overview in the future. diff --git a/module/calp/util.scm b/module/calp/util.scm index 044e4a95..96ca2f01 100644 --- a/module/calp/util.scm +++ b/module/calp/util.scm @@ -362,7 +362,7 @@ ;; NOTE changing this list to cons allows the output to work with assq-merge. (hash-map->list list h))) -;; (group-by '(0 1 2 3 4 2 5 6) 2) +;; (split-by '(0 1 2 3 4 2 5 6) 2) ;; ⇒ ((0 1) (3 4) (5 6)) (define-public (split-by list item) (let loop ((done '()) @@ -533,6 +533,10 @@ (define-public (->quoted-string any) (with-output-to-string (lambda () (write any)))) + + + +;; TODO shouldn't this use `file-name-separator-string'? (define-public (path-append . strings) (fold (lambda (s done) (string-append @@ -551,6 +555,7 @@ +;;; TODO shouldn't this use dynamic-wind? To handle non-local exits? (define-syntax let-env (syntax-rules () [(_ ((name value) ...) -- cgit v1.2.3