From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei <damien.mattei@gmail.com> Newsgroups: gmane.lisp.guile.user Subject: Re: overloading an existing operator in Guile Date: Tue, 3 Oct 2023 21:01:19 +0200 Message-ID: <CADEOadeW3ansi0uVkfko1nhh6FrS6_LdYO+3uOppCb8w=XiLEQ@mail.gmail.com> References: <92548a01-6764-cd02-85c7-f0121030e907@telenet.be> <6172B821-4A2E-4BC1-B3CE-D3E7F1E404AB@abou-samra.fr> 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="30273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Maxime Devos <maximedevos@telenet.be>, guile-user <guile-user@gnu.org> To: Jean Abou Samra <jean@abou-samra.fr> Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Oct 03 21:02:10 2023 Return-path: <guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org> 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 <guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org>) id 1qnkeo-0007dG-Tp for guile-user@m.gmane-mx.org; Tue, 03 Oct 2023 21:02:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guile-user-bounces@gnu.org>) id 1qnkeG-0005fp-Cy; Tue, 03 Oct 2023 15:01:36 -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 <damien.mattei@gmail.com>) id 1qnkeF-0005fX-5H for guile-user@gnu.org; Tue, 03 Oct 2023 15:01:35 -0400 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <damien.mattei@gmail.com>) id 1qnkeD-0000vO-E8 for guile-user@gnu.org; Tue, 03 Oct 2023 15:01:34 -0400 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-533f193fc8dso2241489a12.2 for <guile-user@gnu.org>; Tue, 03 Oct 2023 12:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696359691; x=1696964491; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bQTT3uRb1GDv7aF/v3sjGCVphtmwfOd1VXpbnyBph44=; b=RD5z0nwBtQ7nTdcxhIuUrlqvOJjiy7J7Ri5HY8XwIKyeMIBJEl5e52/50hitNZIBpE lp1eHoMYT5bmDoI1yhw3C4F+qsUMhXpP0FgROBGxZAUAwIfvEIWGYYJWLgtab0DpTFI4 QfOaexsM9eGogAnUPn3RdosNFhssBVlr5ne+7N2eOeygOhtHURZ3jV+nj49oJeq0mI2u btqA7KJWIA1gHYr0TDxMUi4jVFPiX8QjRMUB18GYzfxWZxktzAqje/A2ssy7/70Y/MBC 1z278DyosqOTXSpuGdSBdZG+8bG3LMor/f3xGKI8JM9bL03LU5EeHR8BTAXty2yVN62h QVzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696359691; x=1696964491; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bQTT3uRb1GDv7aF/v3sjGCVphtmwfOd1VXpbnyBph44=; b=tprnLvL9FvUuPkSHCyFBTInWKpJ8HgsZH/0ZbbNLjU1hVndRbrEgQ2GN/xOdAMmayF D6ZpgBhNzV59OSIk7SScCZFhRQE+VPlim95xAJil1wNmRVqt2bl/BH/bn+tlrxZlMVpw DU7+VNcwioZzu/sjTJ/f/SkpDELHLamPfACmcIKCY0F5nMKcTNjlMRbaG5GIfqJW0jHQ 9uKlVoSk+/R52somPbAs/gJJgwigFjttgyZKRe8UihayGttlRgvAS2h8+6LlF3eSa6l2 NdxYD39qOUyYc9w3zD0QgVCBOfaa1rbZBpoUEhfUC07kjDN7m/5jlf8JIxK5zRrqGBLt wHSA== X-Gm-Message-State: AOJu0Yzr4awSrKhCYFDs1hWi4HbrBXPYEGiMd1gtnuQOjl1N9V598M38 fPjFow6j9ODZdNRssJskiozHJS/9uF8bY8kF8jppgd8k X-Google-Smtp-Source: AGHT+IEpXSncSGXMRUQNC7bHLY4VJvy7DOWg3BHLxcJeL+w28MhX+bv8xl6gwthLQdnpRGLrZqS0qXMWG0j17y80JV8= X-Received: by 2002:aa7:d14a:0:b0:533:3cdd:3faf with SMTP id r10-20020aa7d14a000000b005333cdd3fafmr67231edo.1.1696359691162; Tue, 03 Oct 2023 12:01:31 -0700 (PDT) In-Reply-To: <6172B821-4A2E-4BC1-B3CE-D3E7F1E404AB@abou-samra.fr> Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=damien.mattei@gmail.com; helo=mail-ed1-x52b.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 <guile-user.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guile-user>, <mailto:guile-user-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guile-user> List-Post: <mailto:guile-user@gnu.org> List-Help: <mailto:guile-user-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guile-user>, <mailto:guile-user-request@gnu.org?subject=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:19220 Archived-At: <http://permalink.gmane.org/gmane.lisp.guile.user/19220> i agree with you all but there is a misunderstanding of what i'm currently doing. I'm not making + that append vectors a part of Scheme+, it is just for a personal program that i want to overload it. This will never be in Scheme+. (even if python use + for appending list, and list in python are half way from scheme's vectors and scheme's list, perheaps the confusion is coming from that) On Tue, Oct 3, 2023 at 8:41=E2=80=AFPM Jean Abou Samra <jean@abou-samra.fr>= wrote: > > > > Le 3 oct. 2023 =C3=A0 20:35, Maxime Devos <maximedevos@telenet.be> a = =C3=A9crit : > > > > It's explained in =E2=80=98(guile)Methods and Generic Functions=E2=80= =99 how to do this. > > > > 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 "tr= ait coherence".) > >