unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Alex Vong <alexvong1995@gmail.com>
Cc: 33215@debbugs.gnu.org
Subject: [bug#33215] [PATCH 06/11] build-system: Add 'clojure-build-system'.
Date: Tue, 20 Nov 2018 23:03:00 +0100	[thread overview]
Message-ID: <87in0rv23v.fsf@gnu.org> (raw)
In-Reply-To: <87wopyfxyl.fsf@gmail.com> (Alex Vong's message of "Wed, 31 Oct 2018 14:10:26 +0800")

Alex Vong <alexvong1995@gmail.com> skribis:

> From c7a763cfa2543119cc707b434efc8680f73f6367 Mon Sep 17 00:00:00 2001
> From: Alex Vong <alexvong1995@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’.

  reply	other threads:[~2018-11-20 22:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31  6:02 [bug#33215] [PATCH 00/11] build-system: Add 'clojure-build-system' Alex Vong
2018-10-31  6:05 ` [bug#33215] [PATCH 01/11] gnu: clojure: Move from java to lisp Alex Vong
2018-10-31  6:06 ` [bug#33215] [PATCH 02/11] gnu: clojure: Remove 'remove-archives' snippet Alex Vong
2018-10-31  6:07 ` [bug#33215] [PATCH 03/11] gnu: clojure: Refactor to ensure there's a single list of libraries Alex Vong
2018-10-31  6:08 ` [bug#33215] [PATCH 04/11] gnu: clojure: Use (guix build java-utils) to simplify build phases Alex Vong
2018-10-31  6:09 ` [bug#33215] [PATCH 05/11] guix: Add clojure-utils Alex Vong
2018-11-20 21:55   ` Ludovic Courtès
2018-11-21 14:35     ` Alex Vong
2018-11-21 22:12       ` Ludovic Courtès
2018-10-31  6:10 ` [bug#33215] [PATCH 06/11] build-system: Add 'clojure-build-system' Alex Vong
2018-11-20 22:03   ` Ludovic Courtès [this message]
2018-10-31  6:11 ` [bug#33215] [PATCH 07/11] gnu: Add clojure-instaparse Alex Vong
2018-10-31  6:11 ` [bug#33215] [PATCH 08/11] gnu: Add clojure-core-match Alex Vong
2018-10-31  6:12 ` [bug#33215] [PATCH 09/11] gnu: Add clojure-algo-generic Alex Vong
2018-10-31  6:13 ` [bug#33215] [PATCH 10/11] gnu: Add clojure-tools-macro Alex Vong
2018-10-31  6:14 ` [bug#33215] [PATCH 11/11] gnu: Add clojure-algo-monads Alex Vong
2018-11-19 12:53 ` bug#33215: [PATCH 00/11] build-system: Add 'clojure-build-system' Danny Milosavljevic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87in0rv23v.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=33215@debbugs.gnu.org \
    --cc=alexvong1995@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).