From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?VG9tbWkgSMO2eW7DpGzDpG5tYWE=?= Newsgroups: gmane.lisp.guile.devel Subject: Exporting a nonexistent variable Date: Mon, 4 Nov 2024 14:26:58 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20816"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Nov 04 13:27:36 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t7wBD-0005En-Dp for guile-devel@m.gmane-mx.org; Mon, 04 Nov 2024 13:27:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7wAp-00028V-Vi; Mon, 04 Nov 2024 07:27:11 -0500 Original-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 1t7wAo-00028M-EG for guile-devel@gnu.org; Mon, 04 Nov 2024 07:27:10 -0500 Original-Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7wAl-0008Sj-RZ for guile-devel@gnu.org; Mon, 04 Nov 2024 07:27:10 -0500 Original-Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2fb3da341c9so38106941fa.2 for ; Mon, 04 Nov 2024 04:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730723224; x=1731328024; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=P+RkRCxsAw0ak+kPDEIc/WZaW+HBbGR7XeDiC0iTqh4=; b=l40ru32xP6NGkN4LGfkswEk4XE6z4t2KUP8xhfcJ3YopdQHlweE+/4Ym6v85gF6+p7 7PaNc/vzsuZbQdHx9khl0SVxCF1DonSGBFbeSt3VQyGm5aDynYdp3q79l8vkoOo9CU3x aXAQyVanh1jzgTRHUzJeIJ4RGC13qHFhB9X0cYOVhK+9MruJ7BFSndLMZeVHhf/asZQ3 JtG+VpFBxC8Ds2bHZTt5oI1kZort1hJ6JAl84jPxxwW/E16t9sKSDgfrBhwcMEsIR/CM C7r7xxDcMemG10sstm+l9fq/Prt+lX8Y93sP+CAqe5UV1mzECdjBMPb4Rm0JxcLn08Qh szkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730723224; x=1731328024; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=P+RkRCxsAw0ak+kPDEIc/WZaW+HBbGR7XeDiC0iTqh4=; b=Ao7UfF2GbTeTnnIeQM0zz7C9MNGfZTTgBG69Re6Q6WP1qnpdpQfZS5a+ZpWl8decdQ DDZulzMYCM2GbegJ+xszMVPVmMa+TaAL9MuB8RP2L2j9pyuKihNSpNcvP1LAzS85C90G 76nfh9HIa3xMRV+jHOlMw6kxoBXUTVbojbXI6GB2F0uhCUa8lgdvSZCtCsSyu80lPKgT jJsNDAhbho6l/jObyVOKYqbwQj8zoWBgEbkADMjdVw+30uKC4IVi6A0zbo72NtYYJ4rC zG1Ohn43MPU+KtYuG+w3mAjbeW+3x0jr8jg+sB8g4qrj40rFCYJDddiJ9WNWgwIETmIq 7Mww== X-Gm-Message-State: AOJu0YxeFvgKP7X18HQUhv6Bxa1L1sSLUQNlHoKVge2rebHcf8UXydBf raoTBr7118VClOZXpWYGyRjMIJ7QwWswTGDTVmktS7lLHQIwqSMo2u1A X-Google-Smtp-Source: AGHT+IETiNBaI7DtVHQsI3Gvfw0yaEdALSnfCFeCrJ+soQbgN2/iIpJVUg5dbPlh/qdaqOqvokXY0A== X-Received: by 2002:a2e:b8c5:0:b0:2f6:5921:f35b with SMTP id 38308e7fff4ca-2fedb7a1fc4mr50513821fa.27.1730723223340; Mon, 04 Nov 2024 04:27:03 -0800 (PST) Original-Received: from [192.168.195.68] (mobile-access-6df049-195.dhcp.inet.fi. [109.240.73.195]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2fdef8c9546sm16477481fa.125.2024.11.04.04.26.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Nov 2024 04:27:01 -0800 (PST) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=tommi.hoynalanmaa@gmail.com; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22753 Archived-At: Exporting a nonexistent variable in a guile module can cause runtime errors. To see this, consider the following example: --- mod1.scm --- (define-module (mod1)) (export myproc) (define (myproc)   (display "Hello\n")) --- end --- --- mod2.scm --- (define-module (mod2)) (export myproc         myproc2) (define (myproc2)   (display "Hello again\n")) --- end --- --- program.scm --- (use-modules (mod1)              (mod2)) (define (main args)   (myproc)) --- end --- Running "guile -e main -s program.scm" causes the following error --- WARNING: (guile-user): `myproc' imported from both (mod1) and (mod2) Backtrace: In ice-9/boot-9.scm:   1762:12  4 (with-exception-handler _ _ #:unwind? _ # _) In unknown file:            3 (apply-smob/0 #) In ice-9/boot-9.scm:     731:2  2 (call-with-prompt ("prompt") # …) In ice-9/eval.scm:     619:8  1 (_ #(#(#))) In program.scm:       6:3  0 (main _) program.scm:6:3: In procedure main: Unbound variable: myproc --- I think Guile could report a warning if a nonexistent variable is exported as the cause of this kind of errors may be difficult to find in a large program.      - Tommi Höynälänmaa -- Kotisivu / Homepage: http://www.iki.fi/tohoyn/ Sähköposti / E-Mail: tommi.hoynalanmaa@iki.fi GPG-sormenjälki / GPG fingerprint: 55F4 2477 7155 3528 5CB2 2B7A BB86 1FDE 4046 0F83 FT, Debian-ylläpitäjä / PhD, Debian Maintainer