solution: scheme@(guile-user)> (define-method (+ (x <vector>) (y <vector>)) (vector-append x y)) ;;; <stdin>:11:46: warning: possibly unbound variable `vector-append' scheme@(guile-user)> (use-modules (srfi srfi-43)) scheme@(guile-user)> (+ 2 3) $3 = 5 scheme@(guile-user)> (+ #(1 2 3) #(4 5)) $4 = #(1 2 3 4 5)
scheme@(guile-user)> {#(1 2 3) + #(4 5)} $5 = #(1 2 3 4 5) On Tue, Oct 3, 2023 at 12:33 PM Damien Mattei <damien.mat...@gmail.com> wrote: > > thank you > i understand i must overload + the usual way in <vector> class > scheme@(guile-user)> <vector> > $2 = #<<class> <vector> 104a6e380> > > about the described problem this should not be a problem because - > <vector> as no sense in term of concatanate > > On Tue, Oct 3, 2023 at 11:19 AM Jean Abou Samra <j...@abou-samra.fr> wrote: > > > > > > > > Le 3 oct. 2023 à 11:14, Damien Mattei <damien.mat...@gmail.com> a écrit : > > > > is it possible to overload an existing operator in Guile? > > > > > > > > Yes, but it's a bit buggy. See > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64508