GNU bug report logs - #33215
[PATCH 00/11] build-system: Add 'clojure-build-system'.

Previous Next

Package: guix-patches;

Reported by: Alex Vong <alexvong1995 <at> gmail.com>

Date: Wed, 31 Oct 2018 06:04:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

Full log


Message #49 received at 33215 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Vong <alexvong1995 <at> gmail.com>
Cc: 33215 <at> debbugs.gnu.org
Subject: Re: [bug#33215] [PATCH 06/11] build-system: Add
 'clojure-build-system'.
Date: Tue, 20 Nov 2018 23:03:00 +0100
Alex Vong <alexvong1995 <at> gmail.com> skribis:

> From c7a763cfa2543119cc707b434efc8680f73f6367 Mon Sep 17 00:00:00 2001
> From: Alex Vong <alexvong1995 <at> gmail.com>
> Date: Thu, 25 Oct 2018 05:44:01 +0800
> Subject: [PATCH 06/11] build-system: Add 'clojure-build-system'.
>
> * guix/build-system/clojure.scm, guix/build/clojure-build-system.scm: New
> files.
> * guix/build/clojure-utils.scm (@*, @@*): New macros.
> (%source-dirs, %test-dirs, %compile-dir, %main-class, %omit-source?,
> %aot-include, %aot-exclude, %tests?, %test-include, %test-exclude,
> %clojure-regex): New variables.
> (package-name->jar-names, canonicalize-relative-path, find-files*,
> file-sans-extension, relative-path->clojure-lib-string, find-clojure-libs,
> compiled-from?, include-list\exclude-list, eval-with-clojure, create-jar):
> New procedures.
> * Makefile.am (MODULES): Add them.
> * doc/guix.texi (Build Systems): Document 'clojure-build-system'.

[...]

> +(define-with-docs canonicalize-relative-path
> +  "Like 'canonicalize-path', but for relative paths.
> +Canonicalizations requiring the path to exist are omitted."
> +  (let ((remove.. (lambda (ls)
> +                    (fold-right (match-lambda*
> +                                  (((and comp (not "..")) (".." comps ...))
> +                                   comps)
> +                                  ((comp (comps ...))
> +                                   (cons comp comps)))
> +                                '()
> +                                ls))))
> +    (compose (match-lambda
> +               (() ".")
> +               (ls (string-join ls "/")))
> +             remove..
> +             (cut remove (cut member <> '("" ".")) <>)

Guile has built-in “relative file name canonicalization”, see
‘%file-port-name-canonicalization’.  Could it be used here?

I think the use of ‘compose’ above is abusive, as explained at
<http://mumble.net/~campbell/scheme/style.txt> (info "(guix) Formatting
Code").

Also I’m not too keen on identifiers that happen to be recognized but
are not quite R5RS: ‘remove..’, ‘include-list\exclude-list’, etc.  It
would be safer to just stick to the same conventions as elsewhere.

Ludo’.




This bug report was last modified 6 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.