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: overloading an existing operator in Guile Date: Tue, 3 Oct 2023 20:41:23 +0200 Message-ID: <6172B821-4A2E-4BC1-B3CE-D3E7F1E404AB@abou-samra.fr> References: <92548a01-6764-cd02-85c7-f0121030e907@telenet.be> Mime-Version: 1.0 (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="18880"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Damien Mattei , guile-user To: Maxime Devos Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Oct 03 20:41:53 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 1qnkLA-0004Vn-VI for guile-user@m.gmane-mx.org; Tue, 03 Oct 2023 20:41:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnkKq-0007fg-Hs; Tue, 03 Oct 2023 14:41:32 -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 1qnkKo-0007ck-C9 for guile-user@gnu.org; Tue, 03 Oct 2023 14:41:30 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnkKm-0004MV-Mu for guile-user@gnu.org; Tue, 03 Oct 2023 14:41:30 -0400 Original-Received: from smtpclient.apple ([78.240.124.64]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.184]) with ESMTPSA (Nemesis) id 1M8hIl-1qjdjA0elF-004jPW; Tue, 03 Oct 2023 20:41:25 +0200 In-Reply-To: <92548a01-6764-cd02-85c7-f0121030e907@telenet.be> X-Mailer: iPhone Mail (20G75) X-Provags-ID: V03:K1:eS4YlQl1riZ6i0T48r0XLPImaC/HIKhaCzEDISKBgJMcwoQJh+Z P1hBLmn7n3oykiOyEhH5MZFdaJviuufa/A2nHbYydq9kKGknTqsrLXLTVEDuLu/mvlLvWmb Y7xNtzwKai+QSp9AXTCbV33uTFLn+DAMhJNGGlZWeBNCvLk6AyNsROpoqT41CeN8KMa9Iqd zF3HzSQ7nryWdIE8zb7cA== UI-OutboundReport: notjunk:1;M01:P0:BPUrF8JiiHM=;bAdzIpHyU/IWgJFeEGfRIgUTtTj fAXzaDpGLEji4EUecDGOiZPTHyfxtXuuIOMGeNnT1q1iW/62kYvtXOLQso+ZQZLTraRqDCAL1 LLDBb70Aqt4sojgzKYZOancLJqd5ZoXkXslKFf34l00EH/DFDjdhwKErhv8m8ZnAjNwKqVPco JSoRVdRW3VmziIj3iN6WIxcpUhNPVlljqWttRSYukTW03tRpXWom+juAWp7fIrjzYoYuHFyn5 prSSIpToeYwundn3wWTRciHjPLH7WT3Z0NMWoiGwcRkkLta+LWGMiGglh+CaeEEhFI2SQLWJu PNsSNxk2VlT7RPY7HA9ZiUpjwTpc2kf9eC0i8yPSl6hDTtAkOiiB4qRm3lYRIP7KWnSOpXGLk gvldSBNZTYoR/WUFTaJTUG0AJDfEauVZvevQg+gH9c2nrsUjNv74OjukN2QLz91xmDyKw1UeE AknSL3PYL9HjMihK/0tDF0FcmjkFLZbQwkp/xmw9QLDxVxCp1otmuBzdqYgcBW71CqyMccmcK qLl0K7Etnhz3FkePJKTI0tcC169cIlRmrvnXtoZMGnb52B8sa1t2LCnY/xtrfxNNB3TVuz4Y6 RKgpzlaKZSxhqYpLypqUrw88ned7FVxkWqIUxP58I2cGOTVRzKTJLhpsWNq/8/oRDjsKTl5lS EYoMOmHWRxmO2HV0P3weP8lv0nk5HWgSNfULohpH33vqVbcUZUcsrFDHNrliiGkiia5RCckqm nx3ID0P/eyguXqPX439Cl7Km4kHu9K1X4vn6TRfXBqY2I+4RQ1x3E2XKUZXixtDcCmHIoR8l Received-SPF: pass client-ip=217.72.192.73; 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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:19219 Archived-At: > Le 3 oct. 2023 =C3=A0 20:35, Maxime Devos a =C3=A9= crit : >=20 > It's explained in =E2=80=98(guile)Methods and Generic Functions=E2=80=99 h= ow to do this. >=20 > However, I very much recommend not doing this in your situation. +1. I'd recommend only implementing a method foo on a type bar if you are in= control of either foo or bar. (Rust has an analogous concept called "trait c= oherence".)