From d7dc7cb92cc88ed3a245e628b424953206a3f784 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 6 Jul 2017 10:03:16 +0200 Subject: =?UTF-8?q?cuirass:=20Stop=20=CE=BB/lambda=20mixing.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bin/cuirass.in: Replace λ by lambda. * bin/evaluate.in: Ditto. * build-aux/guix.scm: Ditto. * examples/gnu-system.scm: Ditto. * examples/guix-track-git.scm: Ditto. * src/cuirass.scm: Ditto. * src/cuirass/base.scm: Ditto. * src/cuirass/database.scm: Ditto. * src/cuirass/ui.scm: Ditto. * src/cuirass/utils.scm: Remove λ* macro. --- bin/cuirass.in | 6 +++--- bin/evaluate.in | 6 +++--- build-aux/guix.scm | 6 +++--- examples/gnu-system.scm | 6 +++--- examples/guix-track-git.scm | 2 +- src/cuirass.scm | 2 +- src/cuirass/base.scm | 10 +++++----- src/cuirass/database.scm | 10 +++++----- src/cuirass/ui.scm | 4 ++-- src/cuirass/utils.scm | 8 +------- 10 files changed, 27 insertions(+), 33 deletions(-) diff --git a/bin/cuirass.in b/bin/cuirass.in index 27efaac..61b9dd8 100644 --- a/bin/cuirass.in +++ b/bin/cuirass.in @@ -89,16 +89,16 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (with-database db (and specfile (let ((new-specs (save-module-excursion - (λ () + (lambda () (set-current-module (make-user-module '())) (primitive-load specfile))))) - (for-each (λ (spec) (db-add-specification db spec)) + (for-each (lambda (spec) (db-add-specification db spec)) new-specs))) (if one-shot? (process-specs db (db-get-specifications db)) (begin (call-with-new-thread - (λ () + (lambda () (while #t (process-specs db (db-get-specifications db)) (sleep interval)))) diff --git a/bin/evaluate.in b/bin/evaluate.in index 09a785b..d1d0767 100644 --- a/bin/evaluate.in +++ b/bin/evaluate.in @@ -40,7 +40,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (stdout (current-output-port)) (stderr (current-error-port))) (save-module-excursion - (λ () + (lambda () (set-current-module %user-module) (with-directory-excursion (string-append cachedir "/" (assq-ref spec #:name)) @@ -52,7 +52,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" ;; Grafts can trigger early builds. We do not want that to happen ;; during evaluation, so use a sledgehammer to catch such problems. (set! build-things - (λ (store . args) + (lambda (store . args) (display "error: trying to build things during evaluation!~%" stderr) (simple-format stderr "'build-things' arguments: ~S~%" args) @@ -71,7 +71,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (#:revision . ,commit))) (eval-id (db-add-evaluation db eval))) (pretty-print - (map (λ (thunk) + (map (lambda (thunk) (let* ((job (call-with-time-display thunk)) ;; Keep track of SPEC id in the returned jobs. (job* (acons #:eval-id eval-id job))) diff --git a/build-aux/guix.scm b/build-aux/guix.scm index 57ba8ab..feb6670 100644 --- a/build-aux/guix.scm +++ b/build-aux/guix.scm @@ -27,10 +27,10 @@ ;; Return #t if FILE in Cuirass repository must be kept, #f otherwise. FILE ;; is an absolute file name and STAT is the result of 'lstat' applied to ;; FILE. - (not (or (any (λ (str) (string-contains file str)) + (not (or (any (lambda (str) (string-contains file str)) '(".git" "autom4te" "Makefile.in" ".go" ".log" "stamp-vti" ".dirstamp")) - (any (λ (str) (string-suffix? str file)) + (any (lambda (str) (string-suffix? str file)) '("trs""configure" "Makefile" "config.status" "pre-inst-env" "aclocal.m4" "bin/cuirass" "bin/evaluate" "config.cache" "guix.scm"))))) @@ -61,7 +61,7 @@ '(#:phases (modify-phases %standard-phases (add-before 'configure 'bootstrap - (λ _ (zero? (system* "sh" "bootstrap")))) + (lambda _ (zero? (system* "sh" "bootstrap")))) (add-after 'install 'wrap-program (lambda* (#:key inputs outputs #:allow-other-keys) ;; Wrap the 'cuirass' command to refer to the right modules. diff --git a/examples/gnu-system.scm b/examples/gnu-system.scm index 8e29fec..4076786 100644 --- a/examples/gnu-system.scm +++ b/examples/gnu-system.scm @@ -69,7 +69,7 @@ (define (package-job store job-name package system) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (λ () + (lambda () `((#:job-name . ,(string-append (symbol->string job-name) "." system)) (#:derivation . ,(derivation-file-name (parameterize ((%graft? #f)) @@ -80,7 +80,7 @@ (define (package-cross-job store job-name package target system) "Return a job called TARGET.JOB-NAME that cross-builds PACKAGE for TARGET on SYSTEM." - (λ () + (lambda () `((#:job-name . ,(string-join (list target (symbol->string job-name) system) ".")) (#:derivation . ,(derivation-file-name @@ -114,7 +114,7 @@ for TARGET on SYSTEM." (define (tarball-job store system) "Return Hydra jobs to build the self-contained Guix binary tarball." - (λ () + (lambda () `((#:job-name . (string-append "binary-tarball." system)) (#:derivation . ,(derivation-file-name (parameterize ((%graft? #f)) diff --git a/examples/guix-track-git.scm b/examples/guix-track-git.scm index 10a3d48..e3531f0 100644 --- a/examples/guix-track-git.scm +++ b/examples/guix-track-git.scm @@ -98,7 +98,7 @@ (define (package-job store job-name package system) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (λ () + (lambda () `((#:job-name . ,(string-append (symbol->string job-name) "." system)) (#:derivation . ,(derivation-file-name (parameterize ((%graft? #f)) diff --git a/src/cuirass.scm b/src/cuirass.scm index 8d729b8..b28e09e 100644 --- a/src/cuirass.scm +++ b/src/cuirass.scm @@ -27,7 +27,7 @@ ;;; Module usages and exports need to be done at expansion time. (eval-when (eval load expand) (let ((i (module-public-interface (current-module)))) - (for-each (λ (m) (module-use! i (resolve-interface m))) + (for-each (lambda (m) (module-use! i (resolve-interface m))) ;; Public modules. '((cuirass base) (cuirass database) diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index 1d15747..f5f80b3 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -54,7 +54,7 @@ (make-parameter (or (getenv "CUIRASS_CACHEDIR") (string-append (or (getenv "HOME") ".") "/.cache/cuirass")) - (λ (val) + (lambda (val) (if (string? val) val (scm-error 'wrong-type-arg @@ -71,7 +71,7 @@ values." (define (call-with-time-display thunk) "Call THUNK and write to the current output port its duration." (call-with-time thunk - (λ (time result) + (lambda (time result) (let ((duration (+ (time-second time) (/ (time-nanosecond time) 1e9)))) (format (current-error-port) "evaluate '~A': ~,3f seconds~%" @@ -150,10 +150,10 @@ directory and the sha1 of the top level commit in this directory." (log (log-file store drv)) (outputs (match (derivation-path->output-paths drv) (((names . items) ...) - (filter (λ (item) + (filter (lambda (item) (valid-path? store item)) items))))) - (for-each (λ (output) + (for-each (lambda (output) (let ((build `((#:derivation . ,drv) (#:eval-id . ,eval-id) (#:log . ,log) @@ -170,7 +170,7 @@ directory and the sha1 of the top level commit in this directory." (format #t "building ~a derivations...~%" (length jobs)) (parameterize ((current-build-output-port (%make-void-port "w"))) (build-derivations store - (map (λ (job) + (map (lambda (job) (assq-ref job #:derivation)) jobs)))) diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm index 91133c2..1ced411 100644 --- a/src/cuirass/database.scm +++ b/src/cuirass/database.scm @@ -71,7 +71,7 @@ will be replaced by ARGS." (define (read-sql-file file-name) "Return a list of string containing SQL instructions from FILE-NAME." (call-with-input-file file-name - (λ (port) + (lambda (port) (let loop ((insts '())) (let ((inst (read-delimited ";" port 'concat))) (if (or (eof-object? inst) @@ -89,7 +89,7 @@ database object." (delete-file db-name)) (let ((db (sqlite-open db-name (logior SQLITE_OPEN_CREATE SQLITE_OPEN_READWRITE)))) - (for-each (λ (sql) (sqlite-exec db sql)) + (for-each (lambda (sql) (sqlite-exec db sql)) (read-sql-file schema)) db)) @@ -105,7 +105,7 @@ database object." (sqlite-close db)) (define* (assq-refs alst keys #:optional default-value) - (map (λ (key) (or (assq-ref alst key) default-value)) + (map (lambda (key) (or (assq-ref alst key) default-value)) keys)) (define (last-insert-rowid db) @@ -169,8 +169,8 @@ INSERT INTO Evaluations (specification, revision) VALUES ('~A', '~A');" (let ((db (db-open))) (dynamic-wind (const #t) - (λ () body ...) - (λ () (db-close db))))) + (lambda () body ...) + (lambda () (db-close db))))) (define* (read-quoted-string #:optional (port (current-input-port))) "Read all of the characters out of PORT and return them as a SQL quoted diff --git a/src/cuirass/ui.scm b/src/cuirass/ui.scm index 801a539..98ee3a9 100644 --- a/src/cuirass/ui.scm +++ b/src/cuirass/ui.scm @@ -27,11 +27,11 @@ (define %program-name ;; Similar in spirit to Gnulib 'progname' module. (make-parameter "" - (λ (val) + (lambda (val) (cond ((not (string? val)) (scm-error 'wrong-type-arg "%program-name" "Not a string: ~S" (list #f) #f)) - ((string-rindex val #\/) => (λ (idx) (substring val (1+ idx)))) + ((string-rindex val #\/) => (lambda (idx) (substring val (1+ idx)))) (else val))))) (define (show-version) diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm index dbe00a0..d966543 100644 --- a/src/cuirass/utils.scm +++ b/src/cuirass/utils.scm @@ -21,13 +21,7 @@ (define-module (cuirass utils) #:use-module (ice-9 match) #:use-module (srfi srfi-1) - #:export (;; Procedures - alist? - ;; Macros. - λ*)) - -(define-syntax-rule (λ* formals body ...) - (lambda* formals body ...)) + #:export (alist?)) (define (alist? obj) "Return #t if OBJ is an alist." -- cgit v1.2.3