Add map-cons

This idiom of converting a list (L1 L2) of two lists into a list of
cons cells was appearing in a few places, so add a function to
encapsulate it.
This commit is contained in:
Leo Butler 2021-04-18 06:44:01 -05:00
parent 80111fa2ec
commit eb0f6c85cc
1 changed files with 2 additions and 0 deletions

View File

@ -115,6 +115,8 @@
(dsv-splitter (delete "" (dsv-splitter s #\newline)) ffprobe-separator))
(define (k-v-parser s)
(read-from-string (dsv-splitter s #\=)))
(define (map-cons l)
(apply (lambda(x y) (map cons x y)) l))
(define (make-dotted-alist s)
(cond ((and (list? s) (= 2 (length s)) (symbol? (car s)))
(cons (car s) (cadr s)))