guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27275: [PATCH 1/2] pull: Add a dependency to guile-git.


From: Ludovic Courtès
Subject: bug#27275: [PATCH 1/2] pull: Add a dependency to guile-git.
Date: Thu, 08 Jun 2017 14:06:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hello!

Mathieu Othacehe <address@hidden> skribis:

>>>            (set! %load-compiled-path
>>>              (cons* json
>>> +                   (string-append #$guile-git "/lib/guile/"
>>> +                                  #$(effective-version)-
>>> +                                  "/site-ccache")
>>
>> ‘guile-git’ can be #f so you have to account for that.
>
> Just on question about that. The easier I come up with is something like
> :
>  
>
> (set! %load-path
>       (append
>        `(,@(if
>                (and #$guile-git #$guile-bytestructures)
>                (list
>                 (string-append #$guile-git "/share/guile/site/"
>                                #$(effective-version))
>                 (string-append #$guile-bytestructures "/share/guile/site/"
>                                #$(effective-version)))
>              '()))
>        (cons* json
>               (string-append #$guile-ssh "/share/guile/site/"
>                              #$(effective-version))
>               %load-path)))
>
> Any idea on how to write that smoothly ?

Maybe with a macro along these lines:

--8<---------------cut here---------------start------------->8---
(letrec-syntax ((maybe-load-path
                 (syntax-rules ()
                   ((_ item rest ...)
                    (let ((tail (maybe-load-path rest ...)))
                      (if (string? item)
                          (cons (string-append item
                                               "/share/guile/site/"
                                               (effective-version))
                                tail)
                          tail)))
                   ((_)
                    '()))))
  (set! %load-path
    (maybe-load-path json guile-git guile-bytestructures)))
--8<---------------cut here---------------end--------------->8---

HTH,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]