1.3 KiB
1.3 KiB
Babel Library
This library contains code blocks to be used by other files in this repository.
Converting Lists
Converting org lists into guix use-
calls.
`(,(make-symbol use-call)
,@(mapcar (lambda (x)
(let ((splits (split-string x)))
(if (and (length= splits 1)
(= 0 all-parens))
(make-symbol (car splits))
(mapcar (lambda (y) (make-symbol y))
splits))))
entries))
Converting Org lists into Scheme symbol lists.
`(list
,@(mapcar (lambda (x) (make-symbol x)) input))
Converting Tables
`(list
,@(mapcar
(lambda (row)
(let ((service-name (cl-first row))
(configuration (cl-second row)))
`(,(make-symbol (s-concat service-name "-service-type"))
(,(make-symbol (s-concat service-name "-configuration"))
,@(car (read-from-string configuration))))))
input))