[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [go-build-system] How to access properties or keys of a package on t
From: |
Leo Famulari |
Subject: |
Re: [go-build-system] How to access properties or keys of a package on the build side? |
Date: |
Wed, 30 Aug 2017 21:01:40 -0400 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Mon, Aug 28, 2017 at 10:32:41PM +0200, Ricardo Wurmus wrote:
>
> Ricardo Wurmus <address@hidden> writes:
>
> > You could also access the arguments of another package with
> > “package-arguments”. Using the “properties” field isn’t pretty because
> > it is a free form alist.
> >
> > You can use “find-tail” to jump to the keyword in “arguments” and then
> > pick the following value.
>
> Here an example:
>
> --8<---------------cut here---------------start------------->8---
> (define (assoc-args-ref pkg key)
> "Return the value associated with KEY in the arguments of package PKG,
> or #F if there is no such key."
> (let ((ref (find-tail (cut eq? <> key)
> (package-arguments pkg))))
> (and=> ref second)))
>
> (assoc-args-ref golang-github-com-audriusbutkevicius-go-nat-pmp
> #:import-path)
>
> => "github.com/AudriusButkevicius/go-nat-pmp"
> --8<---------------cut here---------------end--------------->8---
Thanks, this is a nice example.
I realized that the GOPATH variable can be a list of directories, like
PATH, so I'm working in that direction instead of building the symlink
union.
signature.asc
Description: PGP signature