From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Volf <~@wolfsden.cz> Newsgroups: gmane.lisp.guile.user Subject: How to globally replace core binding? Date: Sun, 26 Nov 2023 18:42:44 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jNzj23xwQwwbDbjv" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27851"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Nov 26 19:15:23 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 1r7Jf8-00070t-Oo for guile-user@m.gmane-mx.org; Sun, 26 Nov 2023 19:15:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7Jef-0006fo-9D; Sun, 26 Nov 2023 13:14:53 -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 1r7J9i-0000mE-Vt for guile-user@gnu.org; Sun, 26 Nov 2023 12:42:55 -0500 Original-Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7J9g-0003Ea-ES for guile-user@gnu.org; Sun, 26 Nov 2023 12:42:54 -0500 Original-Received: by wolfsden.cz (Postfix, from userid 104) id A4E0825D072; Sun, 26 Nov 2023 17:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1701020566; bh=KEWpgjmVTp8j1doFSRhTlA5VK5fLIsofhrL8aJebEKs=; h=Date:From:To:Subject; b=frojBBwzef+8vKf/DtAE7OUjEp9q9ItzDJKQaG9PpE2jh3+RQzy7DgOazelfz5w9S oBh5qbvIlBPtuPFceoo6ZKrd+AWfjooe11fCKOz20VJiPzM4jo/prOmPLmIGDAd/4O jJsGqSvXCQCiedhIiahdBsf52w34rudwqGDv0AKVuzMfTOLYamGbF5Ya47lw6T8jOC uEfKiOcliGCjSKPEIO62saPggZQvSQNk2AGD1XcwPUDxvolg+kRIVOnaxQ2POMRNqp 5zie81h3iEZ7KX7KKFfVmwfWy99r7QC3/omWKE43Bgor4Kl3FzfBPKKic2R+5VB1/n uNuL6tdKP0K0o5tAdrKuv+/eqJmPxDSAZ/Hun0OCQVEpHV3qJgLgMGTpTeIZ9ZKqDz mInwSlu/JIw3i2PrwkrNDsYPIzpctornZj7Sb4F4ukEGLbDMgY2fU/CJIuPur5oFxX Icwn0hYoOMf3+5j6UENoQ3MyKsRkYqkPNFPWqCxRr7xOmIiFsf5eS20vYJ8vzqyuY8 vbjIGfkrgbqFmQSd4GBfd4nLnfIQEYgymhRtD8kKmc+PWizD5Gj3tlNtoqgLWCgFS1 rD0QOJaVnW+DTrZKXozjfOCHbeKhM7m2EQLpWOG684mjBVOhHTyjelg08UpnkMhpJc gA6cLtSEwEEhEQWa5qiKLC7Q= Original-Received: from localhost (unknown [81.17.16.68]) by wolfsden.cz (Postfix) with ESMTPSA id F1DD025D5DF for ; Sun, 26 Nov 2023 17:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1701020566; bh=KEWpgjmVTp8j1doFSRhTlA5VK5fLIsofhrL8aJebEKs=; h=Date:From:To:Subject; b=frojBBwzef+8vKf/DtAE7OUjEp9q9ItzDJKQaG9PpE2jh3+RQzy7DgOazelfz5w9S oBh5qbvIlBPtuPFceoo6ZKrd+AWfjooe11fCKOz20VJiPzM4jo/prOmPLmIGDAd/4O jJsGqSvXCQCiedhIiahdBsf52w34rudwqGDv0AKVuzMfTOLYamGbF5Ya47lw6T8jOC uEfKiOcliGCjSKPEIO62saPggZQvSQNk2AGD1XcwPUDxvolg+kRIVOnaxQ2POMRNqp 5zie81h3iEZ7KX7KKFfVmwfWy99r7QC3/omWKE43Bgor4Kl3FzfBPKKic2R+5VB1/n uNuL6tdKP0K0o5tAdrKuv+/eqJmPxDSAZ/Hun0OCQVEpHV3qJgLgMGTpTeIZ9ZKqDz mInwSlu/JIw3i2PrwkrNDsYPIzpctornZj7Sb4F4ukEGLbDMgY2fU/CJIuPur5oFxX Icwn0hYoOMf3+5j6UENoQ3MyKsRkYqkPNFPWqCxRr7xOmIiFsf5eS20vYJ8vzqyuY8 vbjIGfkrgbqFmQSd4GBfd4nLnfIQEYgymhRtD8kKmc+PWizD5Gj3tlNtoqgLWCgFS1 rD0QOJaVnW+DTrZKXozjfOCHbeKhM7m2EQLpWOG684mjBVOhHTyjelg08UpnkMhpJc gA6cLtSEwEEhEQWa5qiKLC7Q= Original-Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 8cf51cec for ; Sun, 26 Nov 2023 17:42:44 +0000 (UTC) Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline Received-SPF: none client-ip=37.205.8.62; envelope-from=ws@wolfsnet.cz; helo=wolfsden.cz X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 26 Nov 2023 13:14:46 -0500 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:19327 Archived-At: --jNzj23xwQwwbDbjv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I would like to replace a core binding. I know that I can define a module = like this: (define-module (foo)) (define-public (copy-file a b) (display "TODO: implement file copy\n")) And I can later use it scheme@(guile-user)> ,use (foo) scheme@(guile-user)> (copy-file 'a 'b) TODO: implement file copy But! I would like to replace the copy-file globally, for all modules, with= out the need to explicitly import it. I guess I want something in the spirit o= f the `install-suspendable-ports!', so that I could do something like: scheme@(guile-user)> ,use (foo) scheme@(guile-user)> (install-better-copy-file!) I could patch the Guile itself, but I would strongly prefer to avoid that, = for obvious reasons. So, is it possible to achieve what I want, and if so, how? Thank you and have a nice day, Tomas --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --jNzj23xwQwwbDbjv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmVjg4sACgkQL7/ufbZ/ wal6aRAAkW9dm/4mvfmnpoyEkxjqHl3aXY7hPmW+PZwVGjVi4pRoogoOmdNOzNrP IhDYs53gqDomGzFj2glTfmAzyu9NCYViWQlcDoSc5THTvTgBLTonFQovS0zqY48S QD8giL7h63Wwf/jAsbLyPVHI8XZf1y1egmN10BXJ8ttZgLkByzVsKnP9B2Ph0X+E MgPghkCZJj0maVXzcuoYA2zEnNKnuO2klSIJbN67h/usB1H37CBMnfaRes2gkG+j kafQ+CACzZXS8l19MkgIJdzfkdLtbQOkaqsz2hkoYGR07lBUVoywcl2n/oiGxxQe 0Rp/CT4i5NZ5SDCKm3DKCSAAVuDJiNa2xNOYvBUU2lyyBzJVI5WuCWAJAOI8L3eW gepLuI7V8lM9qufodM76ZBAbPajNAL0/e/hGVt5BapEO4DbcVn/aY4ZgU5oDdQss +Ii2oP6d/73Cnn394JHeZ2fgu2+fMdL8/imlqP6OIjFoAjuhYRuItyKN1Mj77sVK WZCiJxEJtjpli7YsevuFEesYF1gQvw1E513KdWcSv9bTpKaKppzFerusvqQGqcuP zWO4WKy6lMjpJjm4LjYx3bb9uIBjuZo7kEwfNCY6DMj5Ha3xCAlcmQCtL11xqL6P pv/03iDzxRxCFyEjHfeRR5DzPH6rlu/23OURRBEVUqpLEEEMfvI= =LHeG -----END PGP SIGNATURE----- --jNzj23xwQwwbDbjv--