From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Linus =?UTF-8?Q?Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#52218: Unable to define more than one R7RS library per file Date: Wed, 01 Dec 2021 11:00:46 +0100 Message-ID: References: <20211201074553.bzuoffwpaxw3da44.ref@localhost> <20211201074553.bzuoffwpaxw3da44@localhost> Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30600"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-4458-g51a91c06b2-fm-20211130.004-g51a91c06 To: "Sam Lee" , 52218@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Dec 01 11:05:15 2021 Return-path: Envelope-to: guile-bugs@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 1msMUD-0007jT-Ey for guile-bugs@m.gmane-mx.org; Wed, 01 Dec 2021 11:05:15 +0100 Original-Received: from localhost ([::1]:46406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msMUB-0001xi-Kx for guile-bugs@m.gmane-mx.org; Wed, 01 Dec 2021 05:05:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msMR9-00064T-Ax for bug-guile@gnu.org; Wed, 01 Dec 2021 05:02:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msMR7-0004tI-Q1 for bug-guile@gnu.org; Wed, 01 Dec 2021 05:02:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1msMR7-0001sM-Nt for bug-guile@gnu.org; Wed, 01 Dec 2021 05:02:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Linus =?UTF-8?Q?Bj=C3=B6rnstam?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 01 Dec 2021 10:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52218 X-GNU-PR-Package: guile Original-Received: via spool by 52218-submit@debbugs.gnu.org id=B52218.16383528777137 (code B ref 52218); Wed, 01 Dec 2021 10:02:01 +0000 Original-Received: (at 52218) by debbugs.gnu.org; 1 Dec 2021 10:01:17 +0000 Original-Received: from localhost ([127.0.0.1]:43241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msMQP-0001r3-04 for submit@debbugs.gnu.org; Wed, 01 Dec 2021 05:01:17 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:45531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msMQM-0001qn-Fw for 52218@debbugs.gnu.org; Wed, 01 Dec 2021 05:01:15 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C64C65C01C5; Wed, 1 Dec 2021 05:01:07 -0500 (EST) Original-Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 01 Dec 2021 05:01:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm1; bh=inQe8 2KhOQ79jlkP1JU7xqGCp5l5izw4EhhQkpckjkk=; b=BXAUorrSssRJTBlket/yF mMtMuEzMUJIXSARKpnSSVcMqjzmzsBFyIrHmC1/NXIfd57eQ8VeX3kdW1UZ7Og/9 oyuNWwagDkLzJYNLSF8eY1wSoek5REe8kp9ug7b3yPKaXDxyf/uereRKOPoQxs7Q ZjaOT2/H94QtXSMZHaGeoct/wDWCvQVTXLJSkVhc91ErKDog57hUlZPXNl5IJMOn fu99Lnv+h2yNxVVAxhPYG6S4hMeyxHQ9QfO+BeaLtRvRimltnhP7rAFT8LXQTXXg ZnRpYBf2GHf/SKmc9QUon0sP2EpHDbCMnoDWgbZXKIB0S6Tnh8xQOExJO+8CWmke A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=inQe82KhOQ79jlkP1JU7xqGCp5l5izw4EhhQkpckj kk=; b=LAm1goJ89uyxHCQNCO5l0PACCWMM8v8lNkHS8izpQ0Oex5AoGN4NlDMZ/ uxz1BFKrb9DB3GbBN3+LpIZgmgnHVh34RSopHFrj1rSegnzfCJlYcLIEOrnacyVw 2UDHfyiGFjhwupWl5TMD0Zr1Io/IT6PIgmrgMXHLmPijr8uTgLPRg7NtqaMHPSXw DbpA+HIXqC6JdJBfNxrX2QV0jOijNahK5hn9nP6NcX7kvpMptJHc+43XJxJzx9Bv ltCPkSztpnG9MdUp3P2MX1sXVfCtR3BEUBQpmBfLFYmG/+fV8H/mtw+XYh27LqS9 4/JdMDG2d2r7emRsv7HlxhMmrEwsQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrieefgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepnfhinhhu shgpuehjnphrnhhsthgrmhcuoehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihfrg hsthdrsghiiieqnecuggftrfgrthhtvghrnheptedvueetheeukeethfduvdejleetffeu vddvueduieeuvdettdeuheehvdejieffnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheplhhinhhushdrsghjohhrnhhsthgrmhesvhgvrhihfhgr shhtrdgsihii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5F03F1BC0061; Wed, 1 Dec 2021 05:01:07 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <20211201074553.bzuoffwpaxw3da44@localhost> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10215 Archived-At: Hi Sam! I am not a maintainer , nor a very proficient guile hacker, but I do hav= e some input. This is in line with the limitations of guile's R6RS implementation. I t= hink this is a long standing, low priority bug. It has to do with the ex= pansion of library (or define-library in this case) not properly resetti= ng the current module.=20 In the manual there is a section called "R6RS incompatibilities" that me= ntions this. Maybe an "R7RS incompatibilities" should be added. Best regards Linus Bj=C3=B6rnstam On Wed, 1 Dec 2021, at 08:45, Sam Lee via Bug reports for GUILE, GNU's U= biquitous Extension Language wrote: > Guile is unable to handle more than one define-library per file. For > example, this is "mylibs.sld", which contains two define-library: > > (define-library (example mylib) > (import (scheme base)) > (export f) > (begin > (define (f x) > (+ x 1)))) > > (define-library (example main) > (import (scheme base) > (scheme write) > (example mylib)) > (export main) > (begin > (define (main) > (display "The answer is: ") > (display (f 1)) > (newline)))) > > > When loading this file into Guile using "guile -l mylibs.sld", or by > using (load "mylibs.sld"), Guile will show this error: > > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /home/user/mylibs.sld > ;;; WARNING: compilation of /home/user/mylibs.sld failed: > ;;; Syntax error: > ;;; unknown location: definition in expression context, where=20 > definitions are not allowed, in form (define (main) (display "The=20 > answer is: ") (display (f 1)) (newline)) > ice-9/psyntax.scm:2794:12: In procedure syntax-violation: > Syntax error: > /home/user/mylibs.sld:14:4: definition in expression context, where=20 > definitions are not allowed, in form (define (main) (display "The=20 > answer is: ") (display (f 1)) (newline)) > > > The error is always caused by the second define-library. Apparently, > Guile no longer understands that define-library is a special form by t= he > time the second define-library is evaluated. Is it not possible to > define two R7RS libraries in the same file? > > Guile version: 3.0.7