help-guix
[Top][All Lists]
Advanced

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

Re: [TIP] Using (@@ module-name binding-name) sometimes might result in


From: Simon Tournier
Subject: Re: [TIP] Using (@@ module-name binding-name) sometimes might result in "unbound variable"
Date: Wed, 13 Sep 2023 10:10:01 +0200

Hi,

Thanks for sharing.

On Tue, 12 Sep 2023 at 08:24, Rodrigo Morales <moralesrodrigo1100@gmail.com> 
wrote:

> I used @@ as stated in the Guile manual [1], but I kept getting the error
> "unbound variable" (please see below).

Indeed.

--8<---------------cut here---------------start------------->8---
$ guix repl
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (define my/config->sxml (@ (gnu home services fontutils) 
config->sxml))
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: config->sxml: unbound variable

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix-user) [1]> (reload-module (resolve-module '(gnu home services 
fontutils)))
$1 = #<directory (gnu home services fontutils) 7f9c30eed000>
scheme@(guix-user) [1]> (define my/config->sxml (@ (gnu home services 
fontutils) config->sxml))
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: config->sxml: unbound variable

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix-user) [2]> (define my/config->sxml (@@ (gnu home services 
fontutils) config->sxml))
scheme@(guix-user) [2]> my/config->sxml
$2 = #<procedure config->sxml (a)>
scheme@(guix-user) [2]> 
--8<---------------cut here---------------end--------------->8---


> #+BEGIN_QUOTE
> Sometimes it might be necessary to revisit the source file by using
> (reload-module (resolve-module module-name)) to make sure that
> all functions are available.
> #+END_QUOTE

[...]

> [1] 
> https://www.gnu.org/software/guile/manual/html_node/Using-Guile-Modules.html#index-_0040_0040

This proposal is for the Guile manual, right?

Well, I do not know if @@ is something Guix should document.

Cheers,
simon



reply via email to

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