unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: Rodrigo Morales <moralesrodrigo1100@gmail.com>, help-guix@gnu.org
Subject: Re: [TIP] Using (@@ module-name binding-name) sometimes might result in "unbound variable"
Date: Wed, 13 Sep 2023 10:10:01 +0200	[thread overview]
Message-ID: <86ttrywl2e.fsf@gmail.com> (raw)
In-Reply-To: <CAGxMbPaUqAv_eHmqUfJp+UYKJCEpcxZR3ovBx-3uYOeuM819oA@mail.gmail.com>

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


  parent reply	other threads:[~2023-09-13  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  8:24 [TIP] Using (@@ module-name binding-name) sometimes might result in "unbound variable" Rodrigo Morales
2023-09-12  8:34 ` Rodrigo Morales
2023-09-13  8:10 ` Simon Tournier [this message]
2023-09-14  0:54   ` Rodrigo Morales

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=86ttrywl2e.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=moralesrodrigo1100@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.
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).