guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 6/6] gnu: Improve error reporting of the use-.*modules macros


From: Chris Marusich
Subject: Re: [PATCH 6/6] gnu: Improve error reporting of the use-.*modules macros.
Date: Sat, 11 Nov 2017 09:00:34 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Heya,
>
> Chris Marusich <address@hidden> skribis:
>
>> Ludovic Courtès <address@hidden> writes:
>>
>>> +(define-syntax-rule (try-use-modules hint modules ...)
>>> +  (eval-when (expand load eval)
>>> +    (%try-use-modules '(modules ...)
>>> +                      (source-properties->location
>>> +                       (current-source-location))
>>> +                      hint)))
>>> +
>>
>> Why is it necessary to use eval-when here?  The Guile manual makes it
>> sound like eval-when is intended to be used with syntax-case macros, not
>> syntax-rules macros.
>
> It’s necessary because ‘use-modules’ (and ‘try-use-modules’ here)
> doesn’t allow you to specify the “phase” (run-time or expansion-time) at
> which you’re “using” the module.  Thus, it assumes you’re using it both
> at expansion-time and at run-time.
>
> The (gnu packages …) modules happen to export a few macros, so it
> doesn’t work if you import them at run-time only.

I see.  Thank you for the explanation.  I think I need to read up more
on how Guile loads, evaluates, compiles, etc. its code.

-- 
Chris

Attachment: signature.asc
Description: PGP signature


reply via email to

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