From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user Subject: Re: Guile import issue Date: Thu, 15 Jun 2023 12:29:30 +0200 Message-ID: <955482b76ca8ddddcbd661ef7b606990bd503128.camel@abou-samra.fr> References: <4e120d8e-f399-caff-8ce3-c432d8213730@posteo.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-sEs/o+8E09Ukz934HeCn" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21905"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) To: Zelphir Kaltstahl , Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jun 15 12:30:17 2023 Return-path: Envelope-to: guile-user@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 1q9kF1-0005Qk-OK for guile-user@m.gmane-mx.org; Thu, 15 Jun 2023 12:30:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9kEX-0002yx-SN; Thu, 15 Jun 2023 06:29:42 -0400 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 1q9kEV-0002yY-2j for guile-user@gnu.org; Thu, 15 Jun 2023 06:29:39 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9kER-0001gr-Hn for guile-user@gnu.org; Thu, 15 Jun 2023 06:29:37 -0400 Original-Received: from [192.168.1.168] ([212.224.226.188]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1Mw8gc-1pt2pE1doK-00s572; Thu, 15 Jun 2023 12:29:32 +0200 In-Reply-To: <4e120d8e-f399-caff-8ce3-c432d8213730@posteo.de> X-Provags-ID: V03:K1:PKZBRynfdZYBmiJbORnZsl4mo42B1py3nuf34veBXpM+OeW1U1y FZ+++2WfT78AMjfF/8BXDMD1wmgEyI36iOdIWcJSos22kJk8cx+wEN/0o9X1dS7RBnIhIXV WCNe4Dl88f5q3VRfKuc+IP7pJabLPyXAaJtjZDiM0yJVx8SM5DmlqHSfi/h7zKt2UZWwCe6 0cACK7bB0ZIUurWVoWuAA== UI-OutboundReport: notjunk:1;M01:P0:1UOwdInTLho=;Nb73t1TamqAsPpsvCQMGY8unBZl P2WsRYurIBBunX8edzqoQZ5bnpiiIkCfGNoRZ8OPeBiJaJwmgcFxizoCxGLITzA4Zwfyf7dBO cA7LY52eH0PB2bQUbleZLwUtqxUOZcsBjj3ca0bgGmIwlBj9Fv6yNGHKMi/PyEEKoS9I3Ydzd 2pYHrN0/tO5AZMOQviHwE7DDUk5wPEG0ydZpwSndDCUi0a+qWvMe/TBYXxLgZEjy6iaTS8Wm7 n86t43OqVSF2e9Hf+kzzH+xBJQcoqjGi01LX/louHpAvPiz5Uo+t9i/6VxR8YPzKctup6kT0V Ontrwt/I/QQWz8vfqzEfF0VtPtWrhiFwabM7oSi8PsiYopvqf8Jxi0ir4PGoUYr7+NL7sjbwH Q12ODRxMlSnzaCwX6uABX+e5XftZtAf61ZMf8WfISRB1+SNQFqTEr3Pl97MLXtCTBLL3qAioy 33Ur7YpcMcpGFs4MaWPEeln/ZHJs6FYmgWjR2rdHQg1yuwNKvdklDLfqW8kWR6Vfy0IF4ntIH HCM702rkB5WWlCaTGT/CQ8f9r9DV90pvlOrv2DvihxXvlzULatpZQ17WnCUlIa9XSYssvRLA5 Aqy2CQgIyRsFmtpXQbwm7Fi0xj6P2PthCfLDg91I9K41GLKHMBVBFXhTvUmoxE30KU9QuhHYy RunfdJNttRuor12YgiLxNIuCSGMIR5dpEw2yRTLzIg== Received-SPF: pass client-ip=212.227.17.24; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19041 Archived-At: --=-sEs/o+8E09Ukz934HeCn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I agree, it seems like a bug. Here is a slightly more minimal example: ``` $ cat rectangular.scm=20 (library (rectangular) (export real-part) (import (guile)) (define real-part car)) $ cat solution.scm=20 (use-modules ((rectangular) #:prefix rect:)) (display (rect:real-part '(1 . 2))) $ guile3.0 --fresh-auto-compile -L . solution.scm=20 [...] ERROR: In procedure real-part: In procedure real-part: Wrong type argument in position 1: (1 . 2) ``` On the other hand, this doesn't happen if you replace rectangular.scm with ``` (define-module (rectangular) #:export (real-part)) (define real-part car) ``` I think the implementation of the R6RS library form is to blame here: look = at this. ``` scheme@(guile-user)> ,expand (library (rectangular) (export real-part) (imp= ort (guile)) (define real-part car)) $1 =3D (begin (let ((m ((@@ (guile) define-module*) '(rectangular) #:filename #f #:pure #t #:version '() #:declarative? #t))) ((@@ (guile) set-current-module) m) m) (let ((iface ((@@ (guile) resolve-r6rs-interface) '(guile)))) ((@@ (guile) call-with-deferred-observers) (lambda () ((@@ (guile) module-use-interfaces!) ((@@ (guile) current-module)) ((@@ (guile) list) iface))))) (if #f #f) ((@@ (guile) call-with-deferred-observers) (lambda () ((@@ (guile) module-export!) ((@@ (guile) current-module)) '()))) ((@@ (guile) call-with-deferred-observers) (lambda () ((@@ (guile) module-re-export!) ((@@ (guile) current-module)) '(real-part)))) ((@@ (guile) call-with-deferred-observers) (lambda () ((@@ (guile) module-replace!) ((@@ (guile) current-module)) '()))) (define real-part car)) ``` As you can see, the library macro has turned the (export real-part) part in= to a re-export from (guile). --=-sEs/o+8E09Ukz934HeCn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZIroCgAKCRCj8PYLiTOX /pmqAP4mGHRqTL/XAvp2J9nTqBPiWmHCi8q6wOOW2LxGs5t/YQEA6F9W1vVgvmwT PrOTIwpQPW0GJXtjc76uh8ESQq08mwY= =ezz1 -----END PGP SIGNATURE----- --=-sEs/o+8E09Ukz934HeCn--