From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "yarl baudig" Newsgroups: gmane.lisp.guile.devel Subject: define-module, #:export and export Date: Wed, 4 Jan 2023 16:11:07 +0100 (CET) Message-ID: 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="29797"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jan 04 17:25:12 2023 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 1pD6Zj-0007Q6-HU for guile-devel@m.gmane-mx.org; Wed, 04 Jan 2023 17:25:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pD6ZG-0000TD-L1; Wed, 04 Jan 2023 11:24:42 -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 1pD5QD-0000eH-J2 for guile-devel@gnu.org; Wed, 04 Jan 2023 10:11:17 -0500 Original-Received: from msg-1.mailo.com ([213.182.54.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pD5QB-0004BG-EL for guile-devel@gnu.org; Wed, 04 Jan 2023 10:11:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailoo.org; s=mailo; t=1672845068; bh=u2RreYcaOIwQXp7U3yUuzu8Tb5yXyW1eWJpfEAHht6g=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: Content-Type:Content-Transfer-Encoding; b=NM2iTcbynEL35wR2lr8XSZ7hOkniEVC7I85Jvs0zP+C5gG1dEj/v2MZqkqbfM3rnl lbvfoz7UD3DNnJG2jl3s/fXyn6aN8fAeTJu4plfK3dpRheaAY0EJaIGPB6PPGdYjUv a3GE5WKi70WlCBtrC3BEECwcaUDWjC7Q+zLl+uog= Original-Received: by www.mailo.com with http webmail; Wed, 4 Jan 2023 16:11:07 +0100 (CET) X-EA-Auth: WNCRC2WM+0N+lEbjAMdS+Z8cQQmF59AhcZ0O2jS5GjlTJVVIn4chyEAhmYxL21YeZKJZeDJKJZacytVUw66/2A8mvAfFMc+C X-Priority: 3 X-Mailer: COMS/EA22.05/r20221103 Received-SPF: pass client-ip=213.182.54.11; envelope-from=yarl-baudig@mailoo.org; helo=msg-1.mailo.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 04 Jan 2023 11:24:41 -0500 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:21539 Archived-At: Hello guile. I don't know if that's a bug. Anyway, I am confused about this so I ask. I= came across this problem playing with guix source code. I will share diffe= rent "tests" each test is a directory with nothing but the files I share. each time the command to try the test (inside it's directory) is `guile --= no-auto-compile -L . main.scm` base/ main.scm: ----- (define-module (main) #:export (valid-path?)) (define-syntax define-enumerate-type (syntax-rules () ((_ name->int (name id) ...) (define-syntax name->int (syntax-rules (name ...) ((_ name) id) ...))))) (define-enumerate-type operation-id (valid-path? 1)) (define-syntax operation (syntax-rules () ((operation name) (lambda () (simple-format #t "~S\n" (operation-id name)) (+ 3 (operation-id name)))))) (define-syntax define-operation (syntax-rules () ((prout (name)) (define name (operation name))))) (define-operation (valid-path?)) (simple-format #t "~S\n" (operation-id valid-path?)) ----- RUNS split-base/ lib.scm: ----- (define-module (lib) #:export (operation-id)) (define-syntax define-enumerate-type (syntax-rules () ((_ name->int (name id) ...) (define-syntax name->int (syntax-rules (name ...) ((_ name) id) ...))))) (define-enumerate-type operation-id (valid-path? 1)) ----- main.scm: ----- (define-module (main) #:use-module (lib) ;; #:export (valid-path?)) (define-syntax operation (syntax-rules () ((operation name) (lambda () (simple-format #t "~S\n" (operation-id name)) (+ 3 (operation-id name)))))) (define-syntax define-operation (syntax-rules () ((prout (name)) (define name (operation name))))) (define-operation (valid-path?)) ;; (export valid-path?) ;; (simple-format #t "~S\n" (operation-id valid-path?)) ----- Now. this RUNS. There is 3 tests from this "split-base" split-define-module-export: from split-base, uncomment "#:export (valid-pa= th?)" : FAILS Note the difference with "base", which RUNS. split-export : from split-base (so, comment again #:export), uncomment "(e= xport valid-path?)" : RUNS Here I note that there is a difference between #:export (...) and (export = ...). Is this a bug? Or an undocumented feature? Or a misunderstanding from= me? split-simple-format : from split-base, uncomment "(simple-format ...)" : F= AILS. Here the "interesting" difference is between base and split-base. I am rea= lly confused there and I am asking for comments, please :). Thank you!