From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.user Subject: Re: using a module : rename a single definition Date: Sun, 3 Mar 2024 13:55:49 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fOrbDf27B+5gPEfM" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19822"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Damien Mattei Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Mar 03 13:56:23 2024 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 1rglOA-0004y3-Sv for guile-user@m.gmane-mx.org; Sun, 03 Mar 2024 13:56:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rglNk-0004wD-8u; Sun, 03 Mar 2024 07:55:56 -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 1rglNh-0004vb-QH for guile-user@gnu.org; Sun, 03 Mar 2024 07:55:53 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rglNf-0001Q5-Sk for guile-user@gnu.org; Sun, 03 Mar 2024 07:55:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To: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=w1VfRTOKl/wykWXk/G0EjmKFIfOrOIpcuF7pNyR1ogo=; b=UXWNsmfC2YPbjPMy65ZMA1wJ0X KsQD6s+gUZ37RdKCjqYR1aRVTAgXiA29418RXWaf0CSIxnnt4roSX1MzGKWUZfE8e86Z+S6bXpmQE 9YMKN3DvdwylST4KsdxX6026kFXIDAsOhIanJBYRqJ0ZBlC9/zF4jQjV6nLb6P/qHUs7gPfdFfpd7 1RiPX4psgAZ/X6zJioxlwHO9z1ZwxFKqVPxP0kyrM5rkV5/Rw6hTS6f2ENp3LmS9gU9cjQ7jxyoW5 z5AgHrPUEZIX5NbNNwyTT7y7lh4wtQmJ8zu/lcgCM6cx0XjcaPbEysMRlpP4j0Y1GRbRNhNNgx5Gp z/opAGoQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1rglNd-0001H1-LA; Sun, 03 Mar 2024 13:55:49 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:19456 Archived-At: --fOrbDf27B+5gPEfM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 03, 2024 at 09:46:41AM +0100, Damien Mattei wrote: > hello, >=20 > is it possible to import a module having just one variable renamed (not > all) , as in Racket: >=20 > (require (rename-in srfi/42 > (: s42:))) ; Eager Comprehensions >=20 > it seems in Guile either all is imported and prefixed or only a selection > of bindings can be imported: I was under the impression that #:renamer should give us enough rope to shoot anyone in the foot ;-) A quick and unscientific test -- this one should rename xcons to snoc and leave all the rest of srfi-1 alone: tomas@trotzki:~$ guile GNU Guile 3.0.9.120-79e836-dirty Copyright (C) 1995-2023 Free Software Foundation, Inc. scheme@(guile-user)> (use-modules ( (srfi srfi-1) #:renamer (lambda (sym) (if (eq? sym 'xcons) 'snoc sym)))) =20 scheme@(guile-user)> (snoc 'a 'b) $1 =3D (b . a) Cheers --=20 t --fOrbDf27B+5gPEfM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZeRzTgAKCRAFyCz1etHa RvsDAJwJkCqqQwePqjZuibmu8DhG8DfULACeIttiWzEzl21rF4iHT9QpJzq6738= =wjRH -----END PGP SIGNATURE----- --fOrbDf27B+5gPEfM--