unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: Jean Abou Samra <jean@abou-samra.fr>
Cc: Maxime Devos <maximedevos@telenet.be>, guile-user <guile-user@gnu.org>
Subject: Re: overloading an existing operator in Guile
Date: Tue, 3 Oct 2023 21:01:19 +0200	[thread overview]
Message-ID: <CADEOadeW3ansi0uVkfko1nhh6FrS6_LdYO+3uOppCb8w=XiLEQ@mail.gmail.com> (raw)
In-Reply-To: <6172B821-4A2E-4BC1-B3CE-D3E7F1E404AB@abou-samra.fr>

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 PM Jean Abou Samra <jean@abou-samra.fr> wrote:
>
>
> > Le 3 oct. 2023 à 20:35, Maxime Devos <maximedevos@telenet.be> a écrit :
> >
> > It's explained in ‘(guile)Methods and Generic Functions’ 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 "trait coherence".)
>
>



      reply	other threads:[~2023-10-03 19:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03  9:13 overloading an existing operator in Guile Damien Mattei
2023-10-03  9:19 ` Jean Abou Samra
2023-10-03 10:33   ` Damien Mattei
2023-10-03 18:24     ` Damien Mattei
2023-10-03 18:34 ` Maxime Devos
2023-10-03 18:41   ` Jean Abou Samra
2023-10-03 19:01     ` Damien Mattei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADEOadeW3ansi0uVkfko1nhh6FrS6_LdYO+3uOppCb8w=XiLEQ@mail.gmail.com' \
    --to=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=jean@abou-samra.fr \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).