From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WHvoKl0gAGWf1gAAauVa8A:P1 (envelope-from ) for ; Tue, 12 Sep 2023 10:25:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WHvoKl0gAGWf1gAAauVa8A (envelope-from ) for ; Tue, 12 Sep 2023 10:25:01 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 44AEC58153 for ; Tue, 12 Sep 2023 10:25:01 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="qJh/OFU7"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694507101; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jEF4Fb73YwXGYyRkgsBA8Kg2jOcC8+AzMSO2oiJudC0=; b=K+D8GTNvjwDWsfUL16obdcow+Osyp22U0fyIOh58HPm8tNtGp/JbZKo9cEj8pUQZmz5eVy Yyovq+MjIGguJ/Pv6t9OAB9admAtfLDGWSxVO6jrIO2JMWI1sx+yomchsXwj2K0y0Ok+iv fBqcy3h4TEY1yQnGvdcUeSBvLioCZCaEgV/WLeUAi7XbaKFyJbBVDQhE/4Gw0oOGRnov+f nSxyrE8rd4fjm8Cn2DimB/NBDSpN5+psb1uSrBWRv+NgIzNTO1Tdq8nW4TdPVtagpnRnA6 8t5oRQ9TY1Aq6u8xtbsAuZBTGDshX8fvtVHTmYnkCb6N6t/MFPKEi9fdsNWZzA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694507101; a=rsa-sha256; cv=none; b=Euwd97XQkUWKpLO67i1MM/tPAKZbjCzxqKLkxsp8oK3NVslthKbDz8ZiYIyF8jYAMRV7jI WJrNpfreFr9W7lEHz+y8lhiVoK8s6fBs53Cvo8rXgt0SOYFB3fld9rFfD8bX1J8Z+LZirt CJwmwLX1lZmbPoTesimHDm5qDnOz83Y5RpKYLDObN4QuvmnneQNSRCWSLNR+dUWhFOSEEw hMAdNief30nCNJK4g0dhpIWdkHWxVswIeGyyIi2hQ0smjXcsGBiOoINONLUCjo+/CLTwku 1XDy2Li6JfrD+quM1ynCZnu/KYS065wxgFWksOx6TuNTGd2i1ngbF2+hG5agUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="qJh/OFU7"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfyh7-0000k8-VZ; Tue, 12 Sep 2023 04:24:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfyh4-0000jn-T7 for help-guix@gnu.org; Tue, 12 Sep 2023 04:24:22 -0400 Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfyh2-0006fW-EP for help-guix@gnu.org; Tue, 12 Sep 2023 04:24:22 -0400 Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-7a7d7a3d975so2138081241.3 for ; Tue, 12 Sep 2023 01:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694507059; x=1695111859; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=jEF4Fb73YwXGYyRkgsBA8Kg2jOcC8+AzMSO2oiJudC0=; b=qJh/OFU7Pwd6rdQPnA4uljqW4Lv2+Ze+NCyOty5EZKyPXj3YKo+zxSoOY/cB8Dd7M2 Tzf2fXlpNxeEt+aJtFxU2gDkJrecJMWRumGrp7dRU+u5mzFP1b3+VQLkq72FFrSmNafY 6rtBw8J0VRMVh58vpQCsK4XMxhDcqX2CaTj/3bvwSRntupfth6YRhrhoTM+8bWmZ5FcR qKuoQ0YeTnxIp9FjAjmpTvTPLrWPrP/DBGmJTz2aoLCdKSka+zL+5h3a+ohT5jXgK9QN JQYh3DUKkMm5WqrVDiVtrXDYGFElRYVsGkjYrBYHBfFXp9dopPUQaHWYUu+C7mEjKndT uTtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694507059; x=1695111859; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jEF4Fb73YwXGYyRkgsBA8Kg2jOcC8+AzMSO2oiJudC0=; b=YN9xyqqrsU3WzWkOqD5DKL4ywBgSb692H29YjTLhzOOz9JulkRG3k8koO5dCH3vt6K wpuhqhzh02YDqmAj34RMxL/zjJ2e6AF2F2Q42/mFrZaqmIzkctrLseiqYXNB+YhIYgLB 24Rgzev6gtUivwLZ7HXWLAf48AKAiLQ8cv1QcCyzxj0WhDJCWi7HX8FrKNBNwBAZl8T6 IzghVCrA1iQRkmxmlpWgdZHoZRjIIrPrMqiP6ZXPPgqpJEtkbOMHFC9dvgKUnbbzkwgK F1k8XYakCN34LU2LIUJnmd9TrwYZA6q8V1ST24ikN7u96X+s9tzg/t1OJSDYedhHl+mT zg4w== X-Gm-Message-State: AOJu0YyoTZ8qMRy3CK7jEuJ68SJ5u6n0t1bhAU3bRnpCe+aJC7oPp9h9 OV8J89E8m9m+jAJGRsONemvfOAgjSTsjpM/8adUzcBk6ZsA= X-Google-Smtp-Source: AGHT+IG0P3FaxQNL6YvoHWO/6fyLFbN1X4CmRERYOCLrqkhb1aM4T1RiOB6FwbEPjdE/Vxo8tEAR8z0Y3hxi4I6Vsys= X-Received: by 2002:a67:e95b:0:b0:44e:bf83:4a19 with SMTP id p27-20020a67e95b000000b0044ebf834a19mr10788471vso.15.1694507058736; Tue, 12 Sep 2023 01:24:18 -0700 (PDT) MIME-Version: 1.0 From: Rodrigo Morales Date: Tue, 12 Sep 2023 08:24:03 +0000 Message-ID: Subject: [TIP] Using (@@ module-name binding-name) sometimes might result in "unbound variable" To: help-guix@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::936; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-ua1-x936.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.64 X-Spam-Score: -9.64 X-Migadu-Queue-Id: 44AEC58153 X-Migadu-Scanner: mx0.migadu.com X-TUID: HOcOAN6SlCTO TL; DR: Today, I wanted to make some experiments with a function, which is not exported, from a module. I used "@@", but I still got an error. I spent a significant amount of time trying to solve this. Someone helped me out. I now want to share this with other Guix users. I used @@ as stated in the Guile manual [1], but I kept getting the error "unbound variable" (please see below). #+BEGIN_SRC scheme (@@ (gnu home services fontutils) config->sxml) #+END_SRC #+RESULTS: #+begin_example 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. #+end_example Someone at #guile helped me out. #+BEGIN_SRC scheme (reload-module (resolve-module '(gnu home services fontutils))) #+END_SRC #+BEGIN_EXAMPLE ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /run/current-system/profile/share/guile/site/3.0/gnu/home/services/fontutils.scm ;;; compiled /home/rdrg/.cache/guile/ccache/3.0-LE-8-4.6/gnu/store/4dc7z9a5is1lv0v2ib9lpc6nvxlqv9gc-guix-1.4.0-10.4dfdd82/share/guile/site/3.0/gnu/home/services/fontutils.scm.go $5 = # #+END_EXAMPLE #+BEGIN_SRC scheme (@@ (gnu home services fontutils) config->sxml) #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE $6 = #sxml (config)> #+END_EXAMPLE Problem fixed. >From what I can see in the messages shown by =reload-module=, this problem was caused because Guile was using a cached version which didn't define "config->sxml" (please correct me if I'm wrong). Would it be possible to mention this possible scenario and the fact that it can be solved by using =reload-module= in the documentation of =@@= at the Info manual [1]? I believe there might be other curious Guix users, like me, who want to call some non-exported functions, and might encounter the exact same problem. Perhaps, adding the following #+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 as it follows: #+BEGIN_QUOTE syntax: @@ module-name binding-name Refer to the binding named binding-name in module module-name. The binding must not have been exported by the module. This syntax is only intended for debugging purposes or as a last resort. 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. See Declarative Modules, for some limitations on the use of @@. #+END_QUOTE [1] https://www.gnu.org/software/guile/manual/html_node/Using-Guile-Modules.html#index-_0040_0040