From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 27 03:44:45 2019 Received: (at submit) by debbugs.gnu.org; 27 Dec 2019 08:44:45 +0000 Received: from localhost ([127.0.0.1]:56485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iklEi-0005Me-Bp for submit@debbugs.gnu.org; Fri, 27 Dec 2019 03:44:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:51604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iklEg-0005MX-BC for submit@debbugs.gnu.org; Fri, 27 Dec 2019 03:44:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52526) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iklEf-0000FN-2d for bug-guile@gnu.org; Fri, 27 Dec 2019 03:44:42 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iklEd-0005Jz-H6 for bug-guile@gnu.org; Fri, 27 Dec 2019 03:44:40 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:45687) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iklEd-0005Hn-Au for bug-guile@gnu.org; Fri, 27 Dec 2019 03:44:39 -0500 Received: from webmail.gandi.net (webmail23.sd4.0x35.net [10.200.201.23]) (Authenticated sender: amirouche@hyper.dev) by relay12.mail.gandi.net (Postfix) with ESMTPA id BF270200005 for ; Fri, 27 Dec 2019 08:44:36 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 27 Dec 2019 08:44:36 +0000 From: Amirouche To: bug-guile@gnu.org Subject: R7RS define-library form is not supported Message-ID: <944e4d1a53eb901af8f06ce2d761e3bb@hyper.dev> X-Sender: amirouche@hyper.dev User-Agent: Roundcube Webmail/1.3.8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.178.232 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Using guile-2.9.7. Here is the tests files: ```scheme $ cat main.scm (import (scheme base)) (import (mylib)) (func) $ cat mylib.scm (define-library (mylib) (export func) (import (scheme base)) (import (scheme write)) (begin (define (func) (display 42)(newline)))) ``` When i run `main.scm` with the `--r7rs` switch I get: ``` $ guile --r7rs -L . main.scm guile: warning: failed to install locale ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/guile/r7rs/main.scm ;;; compiling ./mylib.scm ;;; WARNING: compilation of ./mylib.scm failed: ;;; Syntax error: ;;; mylib.scm:10:4: definition in expression context, where definitions are not allowed, in form (define (func) (display 42) (newline)) ;;; WARNING: compilation of /tmp/guile/r7rs/main.scm failed: ;;; Syntax error: ;;; mylib.scm:10:4: definition in expression context, where definitions are not allowed, in form (define (func) (display 42) (newline)) ;;; compiling ./mylib.scm ;;; WARNING: compilation of ./mylib.scm failed: ;;; Syntax error: ;;; mylib.scm:10:4: definition in expression context, where definitions are not allowed, in form (define (func) (display 42) (newline)) ice-9/psyntax.scm:2800:12: In procedure syntax-violation: Syntax error: mylib.scm:10:4: definition in expression context, where definitions are not allowed, in form (define (func) (display 42) (newline)) ``` Removing the define-library's begin does not help. Replacing define-library with library does lead to another error: ```scheme $ guile --r7rs -L . main.scm guile: warning: failed to install locale ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/guile/r7rs/main.scm ;;; compiling ./mylib.scm ;;; mylib.scm:6:2: warning: possibly unbound variable `import' ;;; mylib.scm:6:2: warning: possibly unbound variable `scheme' ;;; mylib.scm:6:2: warning: possibly unbound variable `write' ;;; : warning: possibly unbound variable `display' ;;; compiled /home/amirouche/.cache/guile/ccache/3.0-LE-8-4.1/tmp/guile/r7rs/mylib.scm.go ;;; WARNING: compilation of /tmp/guile/r7rs/main.scm failed: ;;; Unbound variable: import Backtrace: 3 (primitive-load "/tmp/guile/r7rs/main.scm") In ice-9/eval.scm: 187:27 2 (_ _) 223:20 1 (proc #) In unknown file: 0 (%resolve-variable (7 . func) #) ERROR: In procedure %resolve-variable: Unbound variable: func ``` It says unbound `import` variable. Add (import (only (guile) import)) on top make it work: ```scheme $ cat mylib.scm (library (mylib) (export func) (import (only (guile) import)) (import (scheme base)) (import (scheme write)) (begin (define (func) (display 42)(newline)))) $ guile --r7rs -L . main.scm guile: warning: failed to install locale 42 ``` From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 12 14:33:28 2020 Received: (at 38760-done) by debbugs.gnu.org; 12 Jan 2020 19:33:29 +0000 Received: from localhost ([127.0.0.1]:58007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iqizI-0005iW-OL for submit@debbugs.gnu.org; Sun, 12 Jan 2020 14:33:28 -0500 Received: from fanzine.igalia.com ([178.60.130.6]:49721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iqizG-0005iF-6i for 38760-done@debbugs.gnu.org; Sun, 12 Jan 2020 14:33:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=pyFvhB2wOiy5iILWZ69XqJl01b6Yx2bPeRoI/tUrxgs=; b=dT11YZcsndlkq585NrJ4SZe46744deK06mrHBD60jQQxsYXxsn0b66wvBiUa+0Fxy3g8y23VWvkoKZKP7xKxr6O3KUbhroyrEr/MIUJbXwWEjP8V1Fxy1aYE8gkWCKIXjUvIeyeHcZo3OovvzrJYd4UN55WoUzljUrB+FPoGiHhtA+Abpl9tHJSoscvIt+fWsOL5ZE10VaMxZ7BwFV/TxUMmarZCs3ziwxyC9fB6NvnIalXoID6FTo5YZOS0ayDcF6I+KDPWDAdhdJTb9xE+MUiPALTSh1bW1AA41O1i1HDGDRgsVu6z97d+A9a/thzkZVsqkpouTNYNpnhIEBJMog==; Received: from [88.123.12.110] (helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1iqiz7-0000Du-If; Sun, 12 Jan 2020 20:33:17 +0100 From: Andy Wingo To: Amirouche Subject: Re: bug#38760: R7RS define-library form is not supported References: <944e4d1a53eb901af8f06ce2d761e3bb@hyper.dev> Date: Sun, 12 Jan 2020 20:33:06 +0100 In-Reply-To: <944e4d1a53eb901af8f06ce2d761e3bb@hyper.dev> (amirouche@hyper.dev's message of "Fri, 27 Dec 2019 08:44:36 +0000") Message-ID: <87r204pj0t.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 38760-done Cc: 38760-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Thanks for the report; fixed! Patches welcome if there are any bugs :) Cheers, Andy From unknown Sun Jun 22 00:08:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 10 Feb 2020 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator