From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AMdBARVfRmMuPgAAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 08:30:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cBhiARVfRmNt7QAA9RJhRA (envelope-from ) for ; Wed, 12 Oct 2022 08:30:45 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9CC3E3ED96 for ; Wed, 12 Oct 2022 08:30:44 +0200 (CEST) Received: from localhost ([::1]:47982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiVGI-0003js-5q for larch@yhetil.org; Wed, 12 Oct 2022 02:30:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiV81-0000cK-Hl for help-guix@gnu.org; Wed, 12 Oct 2022 02:22:05 -0400 Received: from koszko.org ([93.95.227.159]:46552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiV7z-0001QT-9X for help-guix@gnu.org; Wed, 12 Oct 2022 02:22:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=koszko.org; s=mail; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tB66SnKIduBuSUN31aFDZQ9T0kNQI1RpVhl4MdOAoAA=; b=Ko8dGE5XvTNZH+zbRhBqLXy5dn M6fIVKdJuuINpNEVSDpMu1NTn+0BgfqLc/VRKzeXZkMlYRisokp1Lfhv0UjwILY/xQptGyCNZehhg Q7LAJBeDtKnnnxClTw6FKPuSgFVyDmjbZHAEZjiChmVxjeVYOXXB3g3+lK47bZiCfk9fKGSvdBauH oVKRRhd0DjrH9klID2aG9sxsZ+sO33iNIoOzhLQZ0Yy7GZwyMXeLH/B82GnpX3X8Z2wJ+c+AKyVJw OQxL10PWz2brSVwk+bQ5sypSBXl4j+Dg9eubZ6Yq4CjsxVu0km//ZPscKSTz5BVvIXIlswISUVun6 IVzku0Q+4RTfGq82c4brMW53aM2ODvuMJNFvwSerzTrHpBMo1Nk/wBSyigPTTTygNl7oyubixzrA7 hTSx4smXd8Mn3xqWVGV5hEmjgCob36xZrl3K0SVrDUwKpHZGN2/IC1oimRsmt68flB/LQjV0zvJSS ZzgjvjAT/ABCLeWgeqmd4gMLhj7el8HcByCcNmn0zas+dZbF/h9H/KlqWed97wwLpTwc7moP4kK4/ JnnURjb0UwhGlBFHFzTA5jKU8QjOHZW1fYGKP27tNWX0r8EUFi/jIVpxTkJ4UzRapnjHp/hfjqkv/ v3Pob8FnYumKlI+GHb5J8IZelovZopLgvfr6uOUtw=; Received: from [77.252.47.255] (helo=koszkonutek-tmp.pl.eu.org) by koszko.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oiV7n-00063A-CE; Wed, 12 Oct 2022 08:21:51 +0200 Date: Wed, 12 Oct 2022 08:21:49 +0200 To: help-guix@gnu.org Cc: jgart Subject: Re: When do you re-export? Message-ID: <20221012082149.36f2993f@koszkonutek-tmp.pl.eu.org> In-Reply-To: <20221011162848.GB19896@dismail.de> References: <20221011162848.GB19896@dismail.de> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/Ik5ZbJYbmOgs9+KfAnk=zzz"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=93.95.227.159; envelope-from=koszko@koszko.org; helo=koszko.org 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_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" Reply-to: Wojtek Kosior From: Wojtek Kosior via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665556244; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tB66SnKIduBuSUN31aFDZQ9T0kNQI1RpVhl4MdOAoAA=; b=ap0hzkXwrgTAL4CwQhEhcQ+eaMGunfQCSzKLCP3IBitxXMWffe95TwTlEPlkQ//JzDdgsh JFEApG6s8ijcbGuPtmzfyec1iowFba6XeGK3hCcbL1yk9M+12cZhOr85bLf0JA9h7hDerM YwmxFG2TjSbX3CiTyQQNOL8R4BM5MJUrrEtjUftdMOTUY7VEQT61CCw2d857/cH52nIB5T bz07h77T/QqNBcjUUwndhEA1oOwQMCbVWWJ4kAJ2x1h0fsuJZ010yQO2ydLIXXrKGN0gJ0 ITSCpF1T7dCGjP0M9NNHxqzYaBKdCvxC9OZ8nyaytk+s7PJYfi2M35GzCagX+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665556244; a=rsa-sha256; cv=none; b=tQaKbMf4MvO+vFUir0+/kHh8lRQVMeUkD9eFhLDPgmKdYiPnWiMP/6fNSUaosjQ0i30laV Z1dn/VgMQaUku1V6HRftSliM+mVggHwy9WAEljQJPHAtoPPLWWLdJDWKU2MvGxDPtpiZKr X+6KNRZKpuqMWVQVP2m4INyPbfe0ILE9Sxac9vtrgI9GpCztlRf9CgWHPqIamzltOSLH16 COk3EFGpBOmbQtog3jJXUFcanJLA+6hxwjwZj/kT+4QQMga3UTy8JaOHU0pnPXZvRAop9Z wKFyB2MG1Gytq4rZv65KmjQou3fnV0hZuy/tb1t+J0OfZ/YNgZejJXhCB90+nQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=Ko8dGE5X; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=Ko8dGE5X; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9CC3E3ED96 X-Spam-Score: -4.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: JWwfQHPWu5+R --Sig_/Ik5ZbJYbmOgs9+KfAnk=zzz Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > Hi, >=20 > When should I re-export something in a module? >=20 > docs say [...] > > The docs don't explain why you would want to even do a re-export in the f= irst place... >=20 > Could someone provide some examples as to why I would want to use this? It > would be much appreciated! >=20 > -- > jgart Hello, Although I have very little scheme knowledge (disclaimer) I thought I could perhaps help using some generic programming knowledge. It seems re-exporting things is just helpful for maintaining the desired code structure. If you're for example writing a library, you might find it useful to split the code into several modules. Typically, only a subset of the functions and structures you define are meant to be exported as library's external API. Meanwhile, as a result of various dependencies between them, the definitions you want to make public might have landed in different code files and effectively in different modules. Now, in order to make them available to library users by the means of a single import, it is perfectly justifiable to have them imported by and re-exported by a single module. Guix itself seems to be doing something like that[1]. And making a "re-export all public definitions" wrapper is just an example. There may be other reasons we might want to have 'foo' importable from module 'bar' despite it being originally defined in some other module (e.g. 'baz') =E2=98=BA Best, Wojtek [1] https://git.savannah.gnu.org/cgit/guix.git/tree/guix.scm#n23 -- (sig_start) website: https://koszko.org/koszko.html PGP: https://koszko.org/key.gpg fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A Meet Krak=C3=B3w saints! #37: blessed Micha=C5=82 Tomaszek Poznaj =C5=9Bwi=C4=99tych krakowskich! #37: b=C5=82ogos=C5=82awiony Micha= =C5=82 Tomaszek https://pl.wikipedia.org/wiki/Micha=C5=82_Tomaszek -- (sig_end) On Tue, 11 Oct 2022 16:28:48 -0500 jgart wrote: > Hi, >=20 > When should I re-export something in a module? >=20 > docs say the following: >=20 > Add all variables (which must be symbols or pairs of symbols) to the > list of re-exported bindings of the current module. Pairs of symbols > are handled as in export. Re-exported bindings must be imported by the > current module from some other module. >=20 > The docs don't explain why you would want to even do a re-export in the f= irst place... >=20 > Could someone provide some examples as to why I would want to use this? It > would be much appreciated! >=20 > -- > jgart >=20 --Sig_/Ik5ZbJYbmOgs9+KfAnk=zzz Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTpcnBg48VjfIpPS0JLxSIcWnn9GgUCY0Zc/QAKCRBLxSIcWnn9 GoKUAQCsMQEm5sJXhCJI1bPyex4t+ccktyGoChA8nDct9KTVcwEA0/c9tq9kJem7 m3+2ej0aqmCumKWyaJ7HW9MAYu8bDwE= =ODae -----END PGP SIGNATURE----- --Sig_/Ik5ZbJYbmOgs9+KfAnk=zzz--