From c0cd1b3ea7753fe2826f7a336019000df9dea96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 12 May 2013 15:46:16 +0200 Subject: Move record utilities to (guix records). * guix/utils.scm (define-record-type*): Move to... * guix/records.scm: ... here. New file. * guix/build-system.scm, guix/packages.scm: Use it. * guix/gnu-maintenance.scm: Likewise. (official-gnu-packages)[alist->record]: Remove. * guix/scripts/substitute-binary.scm: Likewise. (alist->record, object->fields): Remove. * tests/utils.scm ("define-record-type*", "define-record-type* with letrec* behavior", "define-record-type* & inherit", "define-record-type* & inherit & letrec* behavior", "define-record-type* & thunked", "define-record-type* & thunked & default", "define-record-type* & thunked & inherited"): Move to... * tests/records.scm: ... here. New file. --- guix/scripts/substitute-binary.scm | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'guix/scripts/substitute-binary.scm') diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute-binary.scm index 995078e630..5965e936f9 100755 --- a/guix/scripts/substitute-binary.scm +++ b/guix/scripts/substitute-binary.scm @@ -21,6 +21,7 @@ #:use-module (guix store) #:use-module (guix utils) #:use-module (guix config) + #:use-module (guix records) #:use-module (guix nar) #:use-module ((guix build utils) #:select (mkdir-p)) #:use-module (ice-9 rdelim) @@ -103,22 +104,6 @@ pairs." (else (error "unmatched line" line))))) -(define (alist->record alist make keys) - "Apply MAKE to the values associated with KEYS in ALIST." - (let ((args (map (cut assoc-ref alist <>) keys))) - (apply make args))) - -(define (object->fields object fields port) - "Write OBJECT (typically a record) as a series of recutils-style fields to -PORT, according to FIELDS. FIELDS must be a list of field name/getter pairs." - (let loop ((fields fields)) - (match fields - (() - object) - (((field . get) rest ...) - (format port "~a: ~a~%" field (get object)) - (loop rest))))) - (define (fetch uri) "Return a binary input port to URI and the number of bytes it's expected to provide." -- cgit v1.2.3