guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: overloading an existing operator in Guile


From: Damien Mattei
Subject: Re: overloading an existing operator in Guile
Date: Tue, 3 Oct 2023 21:01:19 +0200

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 via email to

[Prev in Thread] Current Thread [Next in Thread]